It is a T-shirt because its shape reminds of a capital letter T, in the same way an A-frame's shape reminds of a capital letter A.
While it is more correct to say the shape reminds of a capital letter T, than a lowercase t, t-shirt would be equally understood.
I have done some online research tonight, and found out that while many other formerly proper nouns such as Internet, and E-mail have transformed into common nouns, the powers-that-be have mostly resisted a similar transformation of T-shirt because the capital letter T shows the approximate shape of the item of clothing. Other words like this are A-frame, C-clamp, I-beam, L-bracket, O-ring, S-curve, T-shirt, T-square, T-junction, T-bar, U-turn, and V-neck.
I did not come up with this myself; I found this information in the answer and ensuing conversation at this ELU question.
I hope this helps, and look forward to hearing what others have to say.