For one thing they are a cheap way of getting people to remember your name, especially on local races. When you have three or four seats up on a school board, not a heck of a lot of folks will know every single person running. They may end up voting by party or basing a decision on mailers or phone calls. But when you see signs for Joe Blow all over the place, it may stick in your head on election day.
Some herd mentality also goes into it. The more your neighbors are putting up yard signs, the more you might be pursuaded to vote for candidate X. After all, folks choose to live around those that they perceive to be like them. If people you like and respect are voting for candidate X, it may be a good choice for you. By showing support for a candidate, it may encourage friends and neighbors to ask you about that candidate.
When you get into major elections they are probably more like Coke and Pepsi advertising than anything else. You do it because its sort of expected. And people want to show their support as much as they would wear a Yankees or Red Sox jersey. I know during the last election there was so much demand from people for signs of both Bush and Kerry that the campaign offices were running out daily and limiting the number you could take when they were in.