The man was given a 15-month suspended sentence and a fine of 1,750 euros (£1,560) for using a bat spiked with nails to assault the woman in the street in 2015, leaving her covered in cuts and bruises.
The prosecutor had argued the sentence was too lenient and asked an appeal court for prison time of three years and six months, but judges rejected his request.
In a written ruling, the judges expressed "some understanding" for the attacker, saying a woman's adultery is "a very serious offence against a man's honour and dignity".
They noted the Bible says an adulterous woman should be punished by death and also cited a 1886 Portuguese law that gave only symbolic sentences to men who killed their wives for suspected adultery.
The judges at the appeal court in Porto, Portugal's second-largest city, wrote that they were making reference to the Bible and an old law "to stress that a woman's adultery amounts to conduct which society has always condemned and condemned very strongly".
The written ruling became public this week and sparked outrage on Portuguese social media, with rights groups speaking out.
The Women's Alternative and Response Union described the ruling as "inadmissible" because it legitimised violence against women and blamed the victim.
It said the separation of powers in Portugal means there is no place for the Bible in the courts.
The group plans to stage street protests on Friday.
Portugal's Superior Magistrates Council, an oversight body, said it had taken note of the "vivid criticism from broad sections of public opinion", but added courts are independent and it could not intervene, even when faced with "archaic, inappropriate or unfortunate" comments by judges.
The woman could appeal to Portugal's higher courts.