What is the meaning of [if wishes were horses, beggars would ride]

There is no point in indulging in wishful thinking.