Jesus was fulfilling the commandment for the High Priest to be washed before taking office. (
Exodus 29:4, 40:12)
That's what he meant when he said he was fulfilling all righteousness. He was assuming the role of High Priest of the new covenant.
After washing, the High Priest was also anointed.... notice the Holy Ghost descending upon him in the form of a dove immediately after Christ came up out of the water.