For example, teacher/student, employee/boss.
After thinking about it more, one rationalization is that we assume it's for the kids' greater good and kids don't know what's best for them while adults do. Of course, one must believe corporal punishment is an effective way to train behavior and the purpose when used is truly to improve the kid's well being.
The only reason corporal punishment was used is because it causes an immediate response but that is one driven by fear. It is control by violence which is by definition a form of domestic violence. As a society we only accept it now in situations by law enforcement. But even then that is limited acceptance (for example in the United airlines incident). As a simple example, you don't teach someone to not hit someone by hitting them. Maybe that model was effective as animals but as humans we have much more powerful behavior modification techniques.
For example, the only thing that really works to modify behavior and generate long term compliance is positive reinforcement. The science is clear. Kids live in the moment. Reward the behavior you want and ignore the behavior you don't. This works surprisingly well with adults as well.
The relationship to a spouse is fundamentally different. In this country, marriage is a union of two equals. You do not give up the legal autonomy granted to you at 18 just because you got married.
Most people would find it weird or creepy to find you were using other kinds of punishment on your spouse, even punishments that are uncontroversial when used on children, just because this implies that you are not respecting your spouse as an equal, but instead treating him or her as a child.