Why did Jesus come to be baptized by John?
In answering this question I should first point out that there was no necessity for John to baptize Jesus. There is nothing that moral man can do for the Son of God. Everything John was doing had a symbolic purpose.
When Jesus told John that the reason for His visit was to "fulfill all righteousness," Hewas informing John that the baptism would play a role in the accomplishment of the Holy Father's will. As a result of Jesus' obedience, He is called the Son of God, the Beloved.
"Then cometh Jesus from Galilee to Jordan unto John, to be baptized of him. But John forbad him, saying, I have need to be baptized of thee, and comest thou to me? And Jesus answering said unto him, Suffer it to be so now: for thus it becometh us to fulfill all righteousness. Then he suffered him. And Jesus, when he was baptized, went up straightway out of the water: and, lo, the heavens were opened unto him, and he saw the Spirit of God descending like a dove, and lighting upon him: And lo a voice from heaven, saying, This is my beloved Son, in whom I am well pleased." (Matthew 3:13-17)
Today, Christians baptize each other as a remembrance of the death and resurrection of Jesus. It can be said that the baptism of John was a precursor to the new birth.