The reproductive glands (ovaries and testes) that produce hormones responsible for sexual development and function.