Leotards aren't made for water use. If you wear a leotard while you're inside the water, it could lead to discoloration. The chlorinated water may dissolve the stitches that are part of the suit as well. The whole purpose of a swimsuit is to stop water from getting to the body, after all.
Don't assume that leotards and swimsuits are interchangeable. Although they often look a lot alike, their "goals" are different. Leotards are often made with spandex, nylon, or even cotton that's smooth. Swimsuits, on the other hand, are often made with blends of elastane and polyester. These are two fabrics that are known to dry remarkably rapidly.
There are other significant reasons to steer clear of substituting a leotard for a swimsuit, too. Leotards understandably do not provide swimmers with optimal water performance. If a leotard becomes wet, getting it off your body may become a tough and time-consuming job. Don't forget that leotards conceal significant portions of the back. That's part of the reason taking off wet leotards can be such a huge chore.
If you want to protect your leotard from possibly detrimental chlorine and aggressive swimming pool chemicals in general, you should keep it out of the water no matter what.