Another reason that Jesus had to be baptized by John was that John was the last Old Testament prophet and Jesus was becoming the High Priest.
Look back at Moses and Aaron.
Exo 40:12 And thou shalt bring Aaron and his sons unto the door of the tabernacle of the congregation, and wash them with water.
Exo 40:13 And thou shalt put upon Aaron the holy garments, and anoint him, and sanctify him; that he may minister unto me in the priest's office.
Exo 40:14 And thou shalt bring his sons, and clothe them with coats:
Exo 40:15 And thou shalt anoint them, as thou didst anoint their father, that they may minister unto me in the priest's office: for their anointing shall surely be an everlasting priesthood throughout their generations.
One purpose of His baptism was that John was washing Jesus for the High Priesthood. Then we see that Jesus is anointed. He was getting ready to fulfill the ministry of the High Priest.
That is why Baptism is essential for us. One of the reasons for baptism is to put us into the area of priesthood.
1Pe 2:9 But ye are a chosen generation, a royal priesthood, a holy nation, a peculiar people; that ye should show forth the praises of him who hath called you out of darkness into his marvelous light: