Children who have had sex are stigmatised by society. They feel victimised and unclean. They can have lifelong esteem problems. Children can be physically injured having sex with adults. Children can be traumatised.
Authority figures can push children into sex even when the children want no part of it.
To set the stage for monogamy and stable relationships. Ironically, the sex itself is not directly harmful. It is all the potential side effects. The law should be changed to be more consistent. It is quite ridiculous that exploiting a child prostitute age 12 is treated as less serious than looking at a naked photograph of a 17 year old.