Humor demonstrates a higher form of consciousness. The term comes from the old idea that our bodies were run by "humors" - so a "sense of humor" means a sense of how life works. It isn't just telling stupid jokes.
Girls often think this makes a male more attractive - to have half a brain. But then there's plenty of girls who like really stupid guys too - the dumber the better.