The first amendment is not related. I think you are talking about the fourth amendment (protection from unreasonable searches and seizures). In this case the online data is stored by the provider, and there is no private location for which to obtain a warrant. The provider's database is not your private domicile. Legally, it is no different from a cop asking a store for footage from their cameras.
Of course, the claim is that it should not be considered this way, because it is bad for privacy. But the reasoning that led here is pretty comprehensible.