Even after reviving answers to this question it still doesn't make sense to me. Jesus was sinless so there was no point of getting baptized,.. what was the purpose for it anyways?
Matthew 3:15
English Standard Version
But Jesus answered him, “Let it be so now, for thus it is fitting for us
to fulfill all righteousness.” Then he consented.
Isaiah 42:21
The LORD is well pleased for his righteousness' sake; he (Jesus) will magnify the law, and make
it honourable. AND HE MOST CERTAINLY DID.
1 Corinthians 1:30
English Standard Version
And because of him you are in Christ Jesus, who became to us wisdom from God, righteousness and sanctification and redemption,
Jesus was baptized on behalf of humanity as whole.
When Jesus came up out of the water the Father was heard saying,
This is My beloved Son, in whom I am well pleased.
Matthew 3:17
When the Father was saying He was well pleased with His Son, His Son was representing the entire human race (as a human). So by accepting His Son, He was accepting the entire human race that through Him (Christ) all who believe in Him will be saved and that was going to be by Him living a perfect righteous life, dying on the cross and being resurrected ... which all of course is symbolized by baptism by submersion.
He made us accepted in the Beloved.
Ephesians 1:6
Baptism is an outward symbol of the commitment you've made in your heart.