9 year old boy constant touching

My 9 year old boy has recently started constantly touching his private’s.

When asked why he does it he says he doesn’t know and can’t help it. Then gets really upset pacing around and crying saying he can’t stop thinking about it.

We have tried to explain to him that he shouldn’t be doing this as don’t want it to be something that continues and gets him in trouble at school or later in life.

We are having to change his pants 2-3 times a day because they are wet where he squeezes after going to the toilet.

It is effecting his ability to do the things he used to enjoy doing.

We just can’t get to the bottom of it.

Any help or advice would be greatly appreciated.

thanks in advance.