We are not told explicitly why the pilot in The Little Prince grew up deciding to be a pilot; however, there are a couple of reasons we can glean from both the text and knowing about the author.
The first reason we can glean from the text is that the pilot says he grew up living a very solitary life. Being a pilot allows him to remain solitary. As a pilot, all there is to the world is himself, his plane, and the endless sky full of endless stars. We know that he grew up living a solitary life because he found that he saw and understood things in a way that others neither saw nor understood. His moment of revelation happens when he shows to the adults his drawing of the boa constrictor digesting an elephant from the outside. The adults, being unobservant and materialistic instantly fail to notice the eyes and the silhouette of the elephant, deduce that it's a drawing of a hat. The pilot's point with the drawing is to show the importance of seeing beyond the obvious, beyond the physical, beyond the corporeal. Hence, throughout his life, the pilot shows the drawing to anyone new he meets and uses it to discern if the person is "a person of true understanding," meaning able to see beyond the obvious. However, every time the person replies, "That is a hat" (Ch. 1). Therefore, as the pilot explains, "So I lived my life alone, without anyone that I could really talk to" (Ch. 2).
Another reason for why the narrator grew up to be a pilot that we can glean from the story also has to do with how we know he sees the world. Since the pilot sees beyond the physical, we know that the sky and stars are very important to him. The sky and stars represent the untouchable, just like the things that are spiritual, such as love. Later, the stars represent for the pilot the things unseen, such as the little prince high up on his own unseen star, laughing, just as we see in the prince's lines:
In one of the stars I shall be living. In one of them I shall be laughing. And so it will be as if all the stars were laughing, when you look at the sky at night. (Ch. 26)
A third reason why the narrator grew up to be a pilot is that the story is actually somewhat autobiographical. The author Antone de Saint-Exupery actually was a French pilot himself. Prior to World War II, he was a French commercial pilot and then joined the French Air Force when the war started. In fact, in 1935, a few years into the start of World War II, Saint-Exupery and his copilot crashed in the Sahara Desert, just as the pilot did in The Little Prince. Saint-Exupery's experience in the desert, particularly his experience with auditory and vivid hallucinations as a result of extreme dehydration, is thought to be a source of inspiration for The Little Prince, which also shows us exactly why the narrator is a pilot who has crash-landed in the Sahara Desert.