The story
1) From the idea of getting a T-shirt for an accomplishment, at a sport tournament for example. 2) From the idea of getting a T-shirt at a tourist spot in order to show others that one has been to that spot.
Etymology from Wiktionary, CC BY-SA 4.0.