To fulfill the prophecies. Jesus was baptized because He had to fulfill the legal requirements for entering into the priesthood. He was priest after the order of Melchizedek (Psalm 110:4; Heb. 5:8-10; 6:20)Jesus became a sacrifice for our sin (1 Pet. 2:24; 2 Cor. 5:21)
To be considered a true priest, He had to be: Washed with water (Lev. 8:6; Exodus 29:4, Matt. 3:16). Anointed with oil (Lev. 8:12; Exodus 29:7; Matt. 3:16)........ Holy Spirit.\ and it was so when He was baptized in water and when the dove descended upon Him....."The Holy Spirit descended from heaven as a dove and rested upon Jesus" (Matt. 3:16). And God said "Thou art my beloved Son, in whom I am well pleased." Mark 1:11. As the Son of God, Jesus was the one God incarnate.
Getting baptized is not a confession of sin Dear one...
Peace and blessings from Texas <><