I grew up riding at a barn who's owner believed people should ride mares only enough to decide which ones to use for breeding, and only expert riders should ride them. She wouldn't even allow mares boarded.
On the other hand, some of my favorite horses since then have been mares. The saying implies that geldings are easy to handle, mares a little harder, and stallions the hardest of all.
To an extent it's true. Stallions are aggressive and have a high libido. And a mare's hormonal cycles can, sometimes, make her less predictable than a gelding.
But it's not always true. I've ridden some highly dominant geldings and some really laid back mares. This saying is often used to justify gender-based "prejudice" when breed and bloodlines are often more important. (Stallions are more difficult, though, which is why we have so many geldings).