One reason dogs sniff our groins is that the area is right in front of them at nose level. They don’t have to jump or crouch. And a dog learns as much about us by sniffing the concentration of chemicals in our “sensitive” area as we do about a dog by looking at and listening to him. He can even pick up information about our emotional state.
But that area is private, and it’s fine if you don’t want your dog “reading” you or other people that way. The solution is to use a calm but firm “Off,” or “Leave it,” followed immediately by a treat and praise if the dog responds to your verbal cue. Do not inadvertently reward the dog for his behavior by flailing your hands and making all kinds of noises. That just turns you into an activated squeaky toy that renders sniffing you all the more interesting and fun.