Back in the old days there were no alarm clocks so God said to Adam "Here is a Rooster I will make him loud and anoying so you know when you have to wake up and go to work" But seriously......I have no idea.
Same reason any bird makes the sounds it does, same reason dog barks, horse neigh's, on and on. He's a rooster, it's what they do.
Now, as to what causes a particular rooster to crow at any given moment? You name it. I know my rooster is a one upper, he will crow so he can be louder then anybody talking nearby or anything else that makes noise nearby. He also crows for about a bazilllion other reasons to numerous to list and also just because the mood strikes.
Occasionally customer's at my husbands mechanic shop will step outside to make a call on their cell phone. Being farm folk they usually wander a few steps over to stand in the shade of my barn. Big mistake. Rooster comes over to the fence and as soon as they start talking he starts crowing in their face! They leave hastily to complete their conversation's in a quieter place and he puff's up with pride that he has run them off.
I suspect it has something to do with advertising their territory, but really don't know. But I would think that mating, and territory would figure into it.
Of course it could be that they crow because they can...