There is a belief that America spent millions of dollars developing a pen that could be used in space, while the Russians simply used pencils. It was a gripe aimed at American excess versus Russian sensibility.
It’s also not true.
The first space pen was invented and funded entirely by a private company called Fisher. They began selling these pens in 1965.
Instead of using gravity, it uses compressed nitrogen to force ink out of the nozzle. This makes it ideal for use in space, underwater, or for writing upside-down. NASA never commissioned it, nor did they contribute any funding to it.
It should be noted, there are other ink-based tools that work in zero gravity. Felt tip pens, for example, work great without gravity. However, felt tips rely on a consistent ink viscosity, which will change in a pressurised capsule, making them a little unreliable. In a worse case scenario–depressurisation–the ink could be forced out of the pen and start floating around the capsule. Not exactly the sort of thing you want to return to after a long spacewalk.
So, what about pencils?
NASA did indeed use pencils right up until the Apollo program. It was at this time they switched to space pens.
When Fisher contacted NASA to try out their pens, they were so impressed that they bought enough of them in bulk to be used on all future space missions. Russia would soon follow suit. By 1969, both America and Russia were using these pens in space.
Pencils have a habit of breaking, shattering, or leaving graphite dust. Don’t forget that pencils are made of wood which may have been treated, and is itself flammable. This would prove to be a serious fire risk in the pressurised, oxygen rich capsule.
For a while, mechanical pencils were favored by NASA; however, these too are dangerous. Stray graphite dust is impossible to gather, highly flammable and conductive–just about the worst thing possible to be floating around in a spacecraft with sensitive electronics that are keeping people alive.
Another issue is that pencils simply aren’t that effective in space. Without gravity to allow the graphite to settle, pencil etchings were prone to severe smearing, making them fairly worthless for permanent documentation. The Russians did use pencils for a brief time, which did not pose the risk to electronics but still suffered from all the other problems, and the paper shrouds used created a lot of flammable waste.
So, the short reason is that astronauts only used pencils when they were waiting for something suitable to be invented. As soon as it was, they switched and never looked back. Even the Russians thought it was a good idea.
Another cool thing about the space pen is that it is quoted as being able to write for exactly 30.7 million miles. Plenty enough for a trip to the moon and back.