The US requires that all passengers arriving at a US airport, whether for transit purposes or not, have permission to enter the US. This means that passengers must be one of:
US citizen or permanent resident (green card holder)
Canadian citizen (or one of some other small visa-free exceptions)
Citizen of a VWP (Visa Waiver Program) country, with ESTA