The major reason given for these laws is to protect young people, often called "minors," from exploitation.
Prostitution is engaging in sexual activity with another person in exchange for compensation, such as money or other valuable goods.
Some laws also could be considered benificial because they prohibit giving drugs (such as alcohol) to minors.
The age of consent differs in every state, and in every country.
The legal age of consent for sex in Tokyo and Nagano is 13, not 18 like the rest of the country.
This map shows the legal status of prostitution (not activities surrounding prostitution such as brothels, pimping etc) by country.