Langland uses the allegory of Jesus as a knight to represent the titanic struggle between the forces of good and evil over humanity. In the 14th century, the time when the poem was written, the ideal of the heroic knight was still very much alive and well. Knights were supposed to adhere to a very strict code of conduct which determined their relations with others. They were expected to be heroic and always had to display the very highest moral standards.
So one can see, then, why Jesus should be represented as a knight. He is the ultimate hero, the brave knight who willingly enters into battle with the forces of darkness to save our souls. He has come to Jerusalem for a joust with the Prince of Darkness himself, to fetch what the "Fiend" has claimed: the fruit of Piers the Plowman.
Of course, the joust is an allegory, as is Jesus's representation as a knight. And although Jesus ends up being crucified, he is still said to have won the joust. Even the blind knight Longeus kneels before the cross and begs for forgiveness after he spears Jesus in the heart. This fits in with Christian orthodoxy, according to which Christ's crucifixion represents his victory over sin and death.