It should be, but is not illegal for the government to ask for private data, or lean on companies to provide it, (see the NSA Warrantless Wiretapping affair, specifically Qwest - the only telco that refused the illegal orders.)
You can be essentially compelled to break the law - and you gain no immunity for being forced. Damned if you don't, convicted if you do.