 Of course, Jesus did not need to do this for his own sake. Jesus has been righteous from eternity, long before he became a man. But he became a man in order that he could be righteous for us, and in order that he could give us his righteousness by grace, as a gift. St. Peter writes, "...for Christ also suffered once for sins, the righteous one for the unrighteous ones, that he might bring us to God."