Men are naturally wired to pay attention when an attractive woman is present.
Beauty triggers a man's brain by
releasing neurochemicals that make them feel amazing when checking out attractive women. Most women know this and love to play the game...thus they take care of their appearance and flirt. Everyone knows that it feels good to look at pretty things.
It's harmless unless they don't control it. If they can't control it then they need some help. Nagging only makes it worse and is cruel. Making light of it, humor, and diverting his attention is helpful. If nothing helps then it could be a relationship issue.