It was necessary to have Walt's product be immediately distinguishable from everything else on the street. Otherwise, the DEA would need to run samples of every batch seized through the lab to check purity etc. to determine if a given product was cooked by "Heisenberg". While this might have been interesting to the science geeks here on /., it would have been boring to the average viewer.
I have a feeling that pinning the blue color on the P2P cook process was done by the writers before they had a scientific adviser onboard. By then, it was too late, and they were stuck with it.
The big scientific screwup on the show is exactly how Walt was managing to get nearly 100% purity from a process that in real life would result in 50% purity at best. Unlike starting from pseudoephedrine, the P2P process results in a racemic mixture of 2 different stereoisomers of methamphetamine, only one of which has any recreational value.
This bit of chemical magic could have been passed off as Walt's "secret process", but on the show both Gale and Declan's crew were also shown creating meth at significantly better than 50% purity using the P2P route, without benefit of Walt's knowledge.