Why was Jesus baptized when he was sinless? Let us read the text:
“Then Jesus came from Galilee to John at the Jordan to be baptized by him, and John tried to prevent Him, saying, “I need to be baptized by you, and are you coming to me?” But Jesus answered and said to him, “Permit it to be so now, for thus it is fitting for us to fulfill all righteousness.” Then he allowed Him. When He had been baptized, Jesus came up immediately from the water; and behold, the heavens were opened to Him, and He saw the Spirit of God descending like a dove and alighting upon Him. And suddenly a voice came from heaven, saying, “This is my beloved Son, in whom I am well pleased.”” (Matthew 3:13-17).
John recognized that Jesus was sinless and he himself was not. He objected to Jesus’ request to be baptized because of this fact. Jesus told him it was needed to be done to fulfill all righteousness. In other words, baptism was a command of God. Even though Jesus had no sins to wash away, the command to be baptized remained, and as an obedient Son, Jesus was baptized. Read John 8:29.
Cornelius was so devout that his prayers came up to God for a memorial. Yet, he was also commanded to be baptized (Acts 10). All on the day of Pentecost were commanded to be baptized (Acts 2:38). The Ethiopian eunuch, Saul of Tarsus, Lydia, the jailer, and the Corinthians were all commanded to be baptized.
This becomes another flaw in the usual arguments that baptism is not necessary. Even it if didn’t have anything to do with removing sins, and verily it does (Acts 2:38), it still remains necessary because it is a commandment of God (Acts 22:16). God is not a respecter of persons (Acts 10:34 f; Col 3:25). If it was commanded for Jesus, and every New Testament Christian convert, then it most certainly is commanded for us today (Mark 16:16)! If we intend to be saved, we must obey the commandments of God (John 14:15 f; John 15:13-14).