Well, maybe in some of the movie cowboys they wore heels to make them look taller.
The real-life cowboys, however, wore them for two reasons:
to keep their feet from slipping out of the stirrups and to put some extra distance between their feet and the muck when walking through fields full of cattle excrement and poop.