Not that it makes a huge difference, but it's actually ICE not TSA (both are in Homeland Security).
Unfortunately, there's a lot of case law that gives Customs the right to search anything for any reason (or no reason), under Article I, Section 8 ("To regulate Commerce with foreign Nations"). The justification is that they can't regulate what they can't inspect.
They're just extending the same policy to computers.
Diplomatic pouches are about the only thing that can't be searched.