Dogs use their powerful sense of smell to gather information. Humans have scent glands in the groin area, and dogs may sniff them out of curiosity, for social identification, or due to stress.
This is not sexually motivated. If the behavior concerns you, consult a veterinarian or certified dog trainer.