In A Midsummer Night's Dream, it can be said that Shakespeare has Puck transform Bottom's head into the head of a donkey quite simply because Bottom is a stereotypical donkey, or as we can say using a harsher term synonymous with donkey, he is a stereotypical ass. Donkeys are known for their stubbornness and stupidity; Bottom proves to be stubborn, stupid, and even arrogant. But more importantly, Bottom is transformed to illustrate Shakespeare's theme of illusion vs. reality.
Bottom's stubbornness and arrogance are first displayed in act 1, scene 2. Bottom thinks very highly of himself as an actor. He thinks so highly of himself that he's not content to simply play the lead role of Pyramus. Instead, he asks also to play the parts of Thisby and even the lion as well, not seeing that there would be a problem in his playing the lead, the heroine, and even the antagonist--all at the same time. Instead, all he sees is that he could play the parts well, as we see him state when commenting on playing the lion's part:
Let me play the lion too: I will roar, that I will do any man's heart good to hear me; I will roar, that I will make the duke say "Let him roar again, let him roar again." (I.ii.65-67)
His inability to see that there is a problem in his playing all three major parts and his excessive enthusiasm about his own performance abilities all help show Bottom is dumb as a donkey and arrogant. Also, while he does eventually give into Peter Quince as their leader, it certainly does take Bottom a while to back down from his request to play all three parts, showing how stubborn he is.
More importantly, his belief in his superior acting skills proves to be only an illusion, just as his belief that he is Bottom proves to be only an illusion when his head is transformed into the head of a donkey. His acting skills are proven to be merely an illusion both in act 3, scene 1 when he comes up with ridiculous ideas for the play and messes up his line delivery, and in the final scene when their play, which is supposed to be a tragedy, sadly makes their audience laugh. Hence, Puck's transformation of Bottom into a donkey also underscores the theme of reality vs. illusion, showing us that Bottom is not truly what he believes himself to be.
I would add, about Bottom, that he has all the qualities mentioned above, plus a deep humanity that allows us, the audience, to recognize ourselves in him. Bottom is one of Shakespeare's most complex Clowns, in that he is not only arrogant, but open-hearted, not only stupid, but possessing an innocent wisdom, and not only stubborn, but easily enchanted. He is of the earth, and also capable of fairyland. We are Bottom, and Shakespeare, in his infinite compassion for humanity, has made him one of the most lovable characters in all of literature.
The donkey's head, which was your question, is Puck's mischievous choice for a scenario that he prepares for the pleasure of Oberon. Humans ARE asses to Puck, and what better scenario than to turn a human's head into an actual ass's head, and have Titania, for Oberon's pleasure, react to the flower love juice by falling in love with this ass-headed mortal. Here, in this thread of the drama, we have the experience of seeing the deepest intermingling in the play of the human world and the fairy realm. Bottom is the only mortal who can actually see and consciously interact with the fairies. It can be attributed to the fact that he ACTUALLY has had a part of his physical body transformed and is therefore part magical himself while in this state.