At 7th Grade he is still very young and during this stage kids develop a lot of curiosity to know things.
You should have casual talk with him and ask him about his thoughts, don't make it an investigation but rather a conversation. try to know about his intention when he did that.
Also check his activities what he do when you are not around and check the kind of friends he played with.
In this age of this internet everything is easily available and parents should check what their child is watching on internet or TV. If he is having a smartphone you can install some apps that locks certain website or content you don't want him to get exposure to.
Does he have a sister or a cousin sister ? how he behaves with them? Ask him to treat all the girls with respect like he treats his sisters.
Children also learns quickly from the adults around them so you should talk to you partner about it and should also be very careful how you behave with others and do things when he is watching.
You should also talk to him about the his day in school and try to know about his thoughts towards his fellow classmates.
Never scold or punish him for such things but help him to channel his thoughts in right direction.
There are really good books out there about the parenting the Boys when they grow and you may get some more good ideas to deal with such situations.