No answer can make total sense. I think some guys are just that clueless and insensitive or that they don't even realize they are doing it. Others are just that cocky. Some guys can never be happy with what they have and are constantly looking to see if someone else is better some how. But I do believe there is always that primeval instinct to be on the look out for a potential mating partner that for some is barely controllable.
I'm not saying that it's right for him to do that, but here's my opinion.
Many of us have the ability to judge people by how they look, I mean we all can acknowledge that one person is appealing while another isn't as up there. We also have the ability to appreciate appearance level too.
Now it's a whole different story if he intentionally looks up pictures of specific girls, makes remarks on it around you, or even shares it with you. That's just being plain douche-y and bad-mannered.