Impersonal passives are used for the same reasons passives are used in general. They allow for the agent to be omitted. If you don't know who did something, it seems quite natural to use a passive.
Federer was beaten.
Someone beat Federer, but I can't think of his name right now.
As guidot rightly pointed out, omitting the agent prevents focussing the listener's attention on the question Who did it? This is why the following passive seems infelicitous.
#My cookies were eaten!
Someone ate my cookies!
If the agent is omitted, attention is shifted to the events that are occuring.
There was singing and dancing.
Es wurde gesungen und getanzt.
One nice example from a newspaper.
Im Burgbachkeller rollen Köpfe, es fliessen Blut und Branntwein, es wird erobert und wortwörtlich in die Kiste gestiegen, es wird gegeizt, gestorben, geprahlt und gesungen. (source)
Es in the above example is a special kind of expletive (known as Platzhalter) that only occurs in first position. If you rephrase the sentences in such a manner that another element occupies first position it disappears, from which it follows that this es is not a subject or an object. (Note how fließen is plural in the above example because Blut und Branntwein is the subject.)
Dort fließen Blut und Branntwein, dort wird gegeizt, gestorben, geprahlt und gesungen.
This creates some ambiguity with verbs that allow their object to be elided.
Das Essen schmeckte komisch, aber es (subj., =das Essen) wurde gegessen.
Die Tische waren besetzt und es (expletive) wurde (Kuchen) gegessen.
Omitting the agent gives more leeway in interpreting who did something than any impersonal subject (man, jemand, irgendwer) could. To requote a part of the newspaper example:
Es wird gestorben, geprahlt und gesungen.
This sentence allows for the interpretation that some people die and some people boast and some people sing, but the three sets are not required to be identical and they can be overlapping. The impersonal passive is completely non-specific here.