Settled law (settled in the 1800s with mail order catalogs) says the following:
- States may levy whatever taxes they want on their residents.
- States may require companies within the state to collect those taxes for them.
- States do not have jurisdiction over interstate commerce, meaning that they cannot impose requirements on companies in other states. Even if those companies are doing business with customers in that state.
The result is that sales tax is owed for out of state purchases, but is rarely collected. Amazon likes it that way, because it makes their goods cheaper. State governments hate it, because their tax revenues are hit.
North Carolina tried the trick of getting Amazon's sales records. With that, they can go to their private citizens and collect owed but unpaid taxes directly. Amazon is fighting it because they want to remain an artificially cheap alternative. The First Amendment issue was a red herring that they managed to make a good legal argument from.