It means he considers she looks better without her hair put up, and he's taken on a condescending way of doing it. His pats essentially state: I don't mean harm, but I don't care what you think of that gesture or this one. And I know the normal way of doing it is merely telling you and letting you make the decision, but what're you gonna do?
So it happened to a friend of yours who's bothered by it? Because in that case you just gotta tell this guy to fuck off. And patting people on the head is patronizing as fuck regardless of the intentions behind it
It means he pulled a rubber band on a girl's ponytail and patted her on the head. Nothing good ever comes from over-analysing simple actions that most likely don't have any meaning deeper than the instant and obvious result of the action.
It means anything from the end of the world to absolutely nothing. Really your reaction to it is more telling, it says, you're a child who reads way too much into simple things done by the opposite sex because of your lack of experience and utter frustration.
We want your attention but are to insecure and immature to start a conversation. If you like the guy, talk to him. If you don't like him, tell him to stop. In my opinion: aim a bit higher for a guy which is a bit more grown up.