Cowboys are called cowboys because they tend to livestocks live cows, sheep etc. It is easier for them to use horses for transportation while doing their work.
So they get the name 'cowboy' not because of riding, but because of tending to cows(or any other animal). They can ride any animal they like(but horse is easy).
Hope it helps!