Honestly, it's a dumb prejudice. Our notions of beauty are culturally constructed and related to power. Women, as subservient objects, historically were supposed to be bimbos -- remember the Stepford Wives? -- and, unfortunately, many women enacted this even when they were smart. It's changing.
If there is a correlation between ugliness and relatively higher intelligence, it's because less attractive women have absented themselves from the sex-power game. Likewise, if there's a correlation between beauty and relatively lower intelligence, it -- like the beauty itself -- is partly in the eye of the beholder. In other words, many beautiful women have learned to act dumb and many men are stupid enough to fall for it.
It's not too different on the male side, either. I always get the immediate stereotype of being dumb on the basis of my slack-jawed but radiant appearance. I used to work the hell out of it as a reporter. People tell stupid people things they will NEVER tell conspicuously smart people.
Camille Paglia once wrote a hilarious essay about this subject.