It sounds like you bought a phone that was reported stolen. It's not uncommon for people to report a phone stolen to claim the insurance but really sell the phone. These phones go into a database of lost and stolen phones and are blacklisted by the wireless carriers. About all you can do is return it to the place you bought it and get your money back.
Manage your T-Mobile account