High heels were originally created for male Persian horse riders in the military who used them to keep their feet in the stirrups. They prevented the riders' feet from slipping forward while riding and when standing during combat.
In the 16th century, Persian royals visited Western Europe and the look caught on amongst the wealthy elite — the higher the heel, the higher the status. King Louis XIV used to parade around in four-inch heels, as can be seen in portraits of him.
Around the same time, women started wearing heels for the opposite reason they do today — to look more androgynous, more male. (Crazy, right!?)
By the end of the 17th century, men's heels were square and wide, while the women's style were pointy and slender. Then, when the Enlightenment brought practical dress, men stopped wearing heels altogether and they transitioned to being a style only for women.