A court in the northern city of Soria found the man guilty of violence against women, banned him from coming within 300 meters of his wife or communicating with her for three years, and of acquiring a weapon during that time.
The sentence stems from an incident during a TikTok "battle" - a real-time competition between streamers where the winner is decided by viewers - held between the woman and three men during the early hours of January 28.
In images that went viral in Spain, the man is seen slapping his wife in the face so hard that her head turns and she bursts out crying.
"The defendant assaulted his wife publicly and openly, in front of thousands of people, with the aim of undermining her physical integrity and humiliating her in public," the court ruled.
"There is no need for a complaint from the victim in gender violence crimes. These should be punished once it becomes clear they have been committed," the court added.
"Broadcasting the slap live is sufficient for the authorities to step in and protect the victim, regardless of whether she recognizes herself as such."
The woman had declined to press charges against her husband and refused to take the stand against him during the trial.
But the court said police had been called to the couple's home in the past because of "disputes between the accused and his wife" which proved there was "continued mistreatment".
Successive Spanish governments on both the right and left have made the fight against domestic violence a priority.
Parliament in 2004 overwhelmingly approved Europe's first law to specifically crack down on gender-based violence.
It established special courts and offered free legal aid for victims, and set up a hotline that would not appear on users' phone bills.