Test platforms almost always suffer from sub-standard wiring, as designers and workers are constantly moving the wiring bus around, and therefore extending and shortening electrical lines. Only a minimal spark can ignite the wiring's insulation, dust bunnies, and anything else flammable.
For most of its existence, NASA has had a "no splice" rule in its manned space flight program. That rule was in effect when CM-012 was delivered to Florida in 1967 for the AS-204 mission tests (later renamed
Apollo 1), but because the Apollo program was on a fast track, the capsule delivered had also been previously used as a wiring test-bed, and was
full of spliced wires, dust, and clipped insulation. In a 16psi pure oxygen environment (with a hatch held closed by that air pressure), it was only a matter of time before that wiring ignited a fire on the pad which killed Gus Grissom, Roger Chaffee, and Ed White.
NASA tried to place the blame on a particular wire that was worn down to the metal by an access panel, but according to a friend of my father who worked on the CM-012, the entire capsule was a violation of manned flight safety standards, and there's no reason to suspect that this particular wire was the cause--it was, according to this fellow, bound to happen.
Edit: I should add that it was probably this incident which galvanized the nation's 500,000 Apollo Project workers into the "it won't happen on my watch" mentality which led to the mission's eventual success. It was upper management which forced CM-012 to go from a testing boilerplate to the first planned manned capsule of the Apollo project. Afterward, they couldn't get away with such cost-and-time saving measures because their own workers would happily report them for the violations. As a result, no Block I CSMs were flown manned, and no more Americans died in the project.