Around 1998, Rex Cauldwell wrote an article for "Fine Homebuilding" magazine about wiring techniques with Romex. As a side note, he showed how he used spray paint to mark the edges on new rolls of Romex, to help his guys grab the right roll from the truck the FIRST time.

Maybe two years later, one cable maker (I think it was Southwire) began to distribute the colored stuff. Other makers quickly followed.

AFAIK, this was a purely voluntary move by the makers, without any code or industry standard to encourage it. I also suspect that there may be some economies involved; adding color makes it easier for the maker to mix in recycled materials.