Answer:
Well it is certainly a good question to ask.
The best answer that we know of is that these societies and nations developed these ideas of “chivarlry” because they wanted to show respect to their fellow man. In these times of war, typically horrific ones at that, they wanted to honor the fallen. By honoring the fallen — even that of the enemy, was a sign of respect for warriors, knights, etc.
Simply put:
People wanted to honor other peoples efforts in fighting for what they believe in.