In this context, the original phrase relates to a steam powered engine... usually a railroad locomotive. Before the locomotive can move it must first build a "head of steam". A cold or stopped steam engine must first have a fire started and the water turned to steam before opening valves to have it enter cylinders... So it (the steam) has to build up to a certain pressure before it's usable. This Inspector stewed about the situation and "built up a head of steam", i.e., became agitated before releasing the pressure into action...