Was this near a high school?
Heh. I was thinking it was to discourage homeless people or old people, but students works, too.
I probably don't need to explain why restaurants might want to discourage homeless people loitering, though of course the ethics of that can be questioned. Back in Boston, though, there was a bit of a stink with a McDonald's located in a touristy/shopping area that was also a residential area with a predominantly older population.
McDonald's side of things was that they'd get groups of old people coming in early in the morning and staying all day. Using the restaurant as a community center, basically, with many people buying only a single cup of coffee or even nothing at all. For large portions of the day that might not be a big deal, but this place was busy for lunch and after work, and there'd be no empty tables for paying customers. So they put up signs similar to the one in the OP.
Needless to say, all hell broke loose. Articles in the (small, local) paper, letters to the editor, it was ridiculous. The manager of the McDonald's also apparently stopped heating the restaurant as much as usual during the winter, and that caused more complaints.
I went there for lunch during the beginning of the mess and overheard a large-ish group of older people complaining about how the manager didn't know what he was doing. He was throwing away business, that sort of thing. It was a largely Jewish area, so there was muttering in Yiddish as well. Fun to listen to, but I was on the manager's side considering none of these people actually had food in front of them.