spaying neutering a dog

If a person is getting a dog due to a psychological need (as recommended by a healthcare professional) is it permissible to have the dog spayed (female) or neutered (male)?

Problematic