i think you will find that these abreviations are used in places where countries need to be represented with a short amount of text. license plates, international sporting events and so on.
the reason it is probably two is simply the nature of abreviation, to make something as short as possible. i imagine it was originally 3 or 4 because two was not enought to make it self evident what country was being talked about.
for example, UK could stand for United Kingdom or Ukrain. leading to a need for clarification and ultimately leading to UKGB being used for the united kingdom of great britain and UKR being used for Ukrain. i would guess that after some time, some official group such as the olympic board or internation aviation union probably had a meeting to crate a official set that worked with just two initials.
this is all just a guess of course, but it makes sense to me.