I'm a nail tech.
Bacterial and fungus will not grow in a bottle of polish - it is made up of solvents. However, nail techs only work on hands that are squeaky clean and sanitized with alcohol-based prepping solutions, while that can't be said for people putting it on while standing in a drugstore.
I don't like the idea of opening a bottle and trying it on, simply because I don't think most people are very careful about how they do it. If they get polish on the threads of the lid, it will gum up the bottle and make it sticky. This is what will cause damage - the little dried bits of polish make flecks in the otherwise smooth finish.
Nail polish doesn't go bad if it's cared for properly. It's also not going to evaporate if the bottle is opened a few times! I've got polishes that I've cared for for 4 or 5 years that are still fantastic (they are colours that aren't very popular, that's why I still have them after that many years). But then I also clean the bottle threads with alcohol each time. I also buy very good polishes - the cheap stuff isn't going to hold up as well.
The nail polish manufacturers could seal the bottles with a plastic sleeve, but by not doing so they are taking the risk of this happening, and risk having returns of sticky bottles. All I would suggest is take a bottle from the back of the display if you are concerned.