People usually throw a coin in the fountain to make a wish or wish for luck. Generally, fountains have been inspired by the romance of the legend behind Rome's famous Trevi Fountain (Fontana di Trevi).
People believe their wishes would be granted if they give up a coin. I believe this tradition stems from hundreds of years ago when people gave up things of humongous value into a reservoir. Now, it's just a penny, which is not of great value at all, therefore does nothing. But again, that is what I believe.