I don't know for sure, but I like to think that they sing because they are joyful. And in singing, they spread that joy around to everyone (humans and animals and probably plants too).
When I am sad, I listen to Nature to cheer me up. It works every time! Even the rain is a beautiful sound.
I did see on the NATURE show that sometimes the males sing and/or dance to attract a female. Depending on the species, the length, the pitch or creativity of the notes determines the bird's strength. The female will always the choose the strongest male she can for her offspring.
I wonder if men strut their stuff the same way? What do you think?