It's a Darwinian thing. Women's fertility decreases and stops earlier than men's. Males who prefer beautiful fertile young women get their genes represented more members of future generations. There's selective pressure for women to be beautiful and for men's brains to recognize that beauty.
The way guys are wired, they are most sexually attracted to healthy women in their prime childbearing years. The way women are wired, they are attracted to healthy, strong, high-status (in modern terms: wealthy/powerful) men who can provide for their children.
Older, ugly women, and poor, inept, low-status guys are similarly discriminated against in the mating game