The main reason for this is if you don't use a base coat. Be sure to use a clear base coat, let that dry, then apply your polish. This will prevent a lot of the staining. Also be sure to remove your polish at least once a week and leave it off for a couple days to allow your nails to get oxygen. Finally make sure you keep them clean and change your polish often so you dont get fungus growing on them. Im a cosmetology instructor and i see this happen more frequently than you would think. Hope that helps :)
Also if it was a dark color its harder for the light to reach your nails to make em white. I know one summer I had a dark color in my toes and it stained my nails too. It fades in time. (:
Lol I was seriously thinking how did blue turn them orange wow won't use that one again
Lol yeah some polishes will stain to avoid that next time put a clear coat on first and then use the colored nail polish :)
Some nail polishes do discolour your nails, they will go back to normal