When Ender and the other new children arrive, they are placed in a bunkroom for initial training; they will not be assigned to an army until training is over. Because Ender broke another child's arm during the flight, he is detained, and when he gets to the bunkroom, all the bunks are taken except for the one closest to the door; the others resent Ender because he has been singled out by Graff as special. However, what they don't know is that bunks closer to the door are usually considered high-ranking, reserved for platoon leaders and the best soldiers:
"You're a toon leader, aren't you?"
Someone nearby snickered.
"Whatever gave you that idea, Wiggin?"
"You have a bunk in the front."
"I bunk in the front because I'm the best sharpshooter in Salamander Army..."
(Card, Ender's Game, Google Books)
Although the front bunk was intended to be an insult, a bullying maneuver by the other children, they unintentionally gave Ender the most prestigious bunk by Battle School rules. This foreshadows his later development into the only Army leader with a perfect win record, and his role as leader of military forces that ultimately win the long Bugger War.
The bottom bunk closest to the door is usually given to the launch group leader. The boys don't like Ender and give it to him, thinking it is the worst bunk.