Apparently, there's not really a fix for it. Apple says it can happen in most small cameras, including every generation of the iPhone.
The purple haze appears when you aim the phone towards a bright light and then move it so the light source is just off screen.
Some experts say the issue could be due to the iPhone 5's new scratch-resistant sapphire crystal lens covering. Apple is not commenting on that.
The company says shielding the lens with your hand should minimize or eliminate the effect.