The storyline also involves the political reasons for putting people into space, asserting that the Mercury astronauts were actually a burden to the program and were only sent up for promotional reasons. Reasons for including living beings in spacecraft are barely touched upon, but the first option considered was to use a chimpanzee (and, indeed, chimpanzees were sent up first).
Another option considered was using athletes already accustomed to physical stress, such as circus trapeze artists. Wolfe states that President Dwight D. Eisenhower, however, insisted on pilots, even though the first crew members would not actually fly the spacecraft.
Probably more than this, following protocols but having an ability to think for themselves on their feet (as opposed to a grunt following minutia orders).
I suspect that decision making process was dramatized in The Right Stuff. Test pilots make sense for several reasons: they already understand aeronautical concepts, are used to g-forces, have experience with state of the art machines, have a high risk tolerance, and are already familiar with following orders.