What inspired people to throw coins into wells or fountains?
Here is an answer I have provided before: This is an excellent article from a credible source, writing from an anthropological/ethnographic perspective. Evidence of people having thrown coins (and other valuable things) into wells and/or water in general goes back to prehistory in Europe, so it clearly is a long-standing tradition without a clear point of origin. One often sees archaeological explanations that explore the idea of water as a 'liminal' space; that is, water (especially in a well that probes deep underground) serves as a point of transition between this terrestrial, ground-based world and another place. Archaeologists attempting to reconstruct a prehistoric mentality maintain that people deposited valuables into water - including the sacrificed 'bog people' - as an offering to non-terrestrial supernatural forces. That's as good a guess as anything else, but since we lack historical records, we are left only to speculate, although one hopes the speculation is informed and not wild.
Somewhere in the murky past is the answer to your question, which is not very satisfying, but this is what we can say: the tradition is very old, and it is so old that people practicing the act today likely do not have a connection with the full, original intended meaning. One throws coins into a 'wishing well' obviously to make a wish, and the idea of throwing them into a fountain in general seems intimately connected with that, but there was certainly a different if not larger context in prehistoric cultures.
Perhaps the idea of purchasing a wish from whatever supernatural agent receives the value of the thing and the sincerity of the act is not that far removed from the original prehistoric practitioners, but there is no way to know with certainty.