Why did Jesus need to be baptized?
Jesus did not need to be baptized. The baptism by John the Baptist was a baptism of repentance, and the sacrament of baptism removes original sin. Since Jesus had neither original sin nor actual sin, he did not need to undergo baptism. However, Jesus also had no need to be born, to suffer, or to die as a man. He did so out of love for humanity.
John the Baptist appears to recognize the strangeness of Jesus asking to be baptized (Matt. 3:14) yet obeys Jesus' request.
The baptism of Jesus began his public ministry and gave the first example that we are to follow. For if Jesus, who had no need of repentance or cleansing, humbled himself, then we all the more need to humble ourselves.
Jesus not only gave the example for us to follow, but many Fathers of the Church commented that in the baptism of Jesus the sacrament of baptism was born. It was a symbolic action that, though the grace of Christ, was changed into an ontological action. When we receive a sacrament, the grace flows to us from the sacrament, but in the baptism of Jesus the grace of Christ flowed into the sacrament.
In salvation history, the Jordan River was very important. It was through the Jordan River that Joshua led the Israelites into the Promised Land. Jesus chose this spot to be baptized so that through his immersion and emergence from the Jordan River all humanity could be led to heaven.
Ultimately, the reason Jesus chose to be baptized in the Jordan by John was not for him but for us.