Puck changes Bottom's head into that of an "ass" or a donkey head. Puck does this as a prank because he enjoys playing tricks on mortals and fairies alike. The transformation is appropriate because Bottom's name is synonymous with "ass" and also because Bottom's personality is stubborn and pushy. We see this when Bottom is attempting to take all the good parts of the play he and his acting group are preparing for Hippolyta's and Theseus' wedding feast.
When Bottom wakens Titania with his braying, she falls instantly in love with him. This is a result of a spell placed on her by Oberon, the King of the Pixies. Oberon puts this spell on Titania because they have had a disagreement, and he wishes to get revenge by making her fall in the love with the first thing she sees upon waking. Her love affair is good for a few laughs, and then he removes the spell as she recounts the "dream" she had.
Puck changes Bottom into a man with the head of a donkey through magic. He also uses the same magic flower intended for the human lovers on Titania, so that she falls in love with Bottom as soon as she sees him. It's appropriate because Bottom is many things, but among others, he's a fool: he is an ass. This makes his inner nature real and visible. As far as why he does it, it's because he's Puck. I'm serious. He's a creature of whimsy. He's willing and clearly able to transform people for the sake of his own entertainment.
why did Puck transformed Bottoms head in to an ass?