This response from the Norwegian foreign office makes it seem like the man lacked proper documentation, which led to the search. However, it’s unclear to me whether the comment is specific to this case or just a general statement.
"DHS communicates a traveler’s ESTA status to the carriers. However, DHS recommends that travelers print out the ESTA application response as a record of their ESTA application number to confirm their ESTA status."
https://www.cbp.gov/travel/international-visitors/esta/frequ...
They also have DHS Agents on the departure Airports, which already tell the Airlines which Passengers aren't allowed to board. If the Airlines violate against this, they face severe consequences like a ban from US Airspace
https://netzpolitik.org/2014/bundesregierung-beauskunftet-re...