If the government can demand records for "an investigation to ensure compliance with duties, taxes and fines and other customs and immigration matters", they can demand records for anyone else with similarly vague justifications. It's fortunate that there are organizations like Twitter willing to take a stand against it, I guess many others would just hand over the data.
There are legitimate, appropriate ways for the government to subpoena, court order, and issue warrants for certain records from social media like Twitter, Facebook, Reddit, and HN. For some insight into this process, Reddit just published their 2016 Transparency Report: