Jesus performed many actions during his life on earth for other people, not for himself.
His baptism in the Jordan by the hand of St. John the Baptist is a perfect example of such an action that was not for him, but for others.
Holy water
St. Maximus of Turin provides his commentary on Jesus' baptism in a homily featured in the Church's Office of Readings:
Someone might ask, “Why would a holy man desire baptism?” Listen to the answer: Christ is baptized, not to be made holy by the water, but to make the water holy, and by his cleansing to purify the waters which he touched. For the consecration of Christ involves a more significant consecration of the water.
It was Jesus' divine holiness that sanctified the waters of baptism, not for him, but for all humanity.
St. Maximus further expands on this concept in his homily:
For when the Savior is washed all water for our baptism is made clean, purified at its source for the dispensing of baptismal grace to the people of future ages. Christ is the first to be baptized, then, so that Christians will follow after him with confidence.
Jesus' baptism then makes sense, knowing that it was not an act of repentance for Jesus, but a way he could establish a sacrament that all of us could partake in and be cleansed of our sins.