When you say it barely fits that sounds to me like it had to be forced. If it had to be forced is possible the tray or the contacts on the inside may of been damaged.
It's also possible that the SIM card is now defective.
you can always try someone else's SIM card in that phone to see if their card works and if it does not work then quite possibly there is some sort of SIM tray damage.
Manage your T-Mobile account