I'm asking for a friend. She was paying for her adult sons iPhone 7 Plus device on the sprint network and he got arrested for hitting her?

And is no longer allowed in the house. Long story short the police managed to confiscate the iPhone and gave it to her before he was arrested. She now wants to give the phone to her other son, and doubts her arrested son will comply with giving her the passcode. Is there anyway sprint would erase the phone for her so it's like a brand new phone? Or is the son legally supposed to give her the passcode? Anything we can do or is the phone useless.

Your friend should take the phone to where she bought it and request the phone be restored to default.

Sprint might be able to help her reset the password

If she's paying for the phone on paper, I mean if the son's account is under her name then Sprint will help. If her son doesn't comply, he can't be forced.

The carrier can't reset the device, they have no access to the operating system.

IF your friend is the account holder/legal owner of the device and can prove that to APPLE, then an Apple store can factory reset it.

Resetting it and removing the passcode is fairly simple; the passcode is just privacy and as long as you do not mind losing the phone content it can be cleared.

What you can't do is unlink the phone from the owners Apple account without their cooperation. As long as you know the apple account details (eg. Usually the one used to add apps to the phone) you can safely erase it.

Without that info, it's a paperweight… You would have to change the password on the apple account first.
See here:

To reset the phone, you need a computer with itunes installed (and be able to log in to the same apple account the phone is on, as above).

Then follow the procedure here

If he set up the Activation Lock, the iPhone can't be used by anyone but him until he unlocks it with his Apple ID and password