I understand that hydrolox has the highest specific impulse of any conventionally used propellant, but its density is so much lower that you would get more impulse in Newton seconds out of the same volume of kerolox. The density of kerolox is about 0.81–1.02 kg/L, while the density of hydrolox is about 0.36 kg/L at a 6:1 LOX/LH2 ratio, about 35-45% that of the former. In order to have the same impulse for unit volume as RP-1, hydrogen would need to have 2.24 to 2.82 its specific impulse, which it doesn't. Typical hydrogen engines seem to have about 50% higher specific impulse than typical RP-1 engines at sea level. So wouldn't they get better results from putting RP-1 in their first stages instead of hydrogen?
The problem with your analysis is that impulse per unit of volume isn't the right metric.
Impulse is measured in units of force times time. Acceleration is measured in units of force divided by mass, not by volume. A rocket with a given volume of RP-1+LOX is much more massive than a rocket with the same volume of hydrogen+LOX; a given total impulse will yield less total change in velocity for the RP-1 rocket.
The increased volume of a hydrogen rocket does incur a slight mass penalty due to the weight of the empty tank and additional insulation needed, as well as a physically larger rocket engine to deliver equivalent thrust, as well as a drag penalty, so the hydrogen advantage is less than the specific impulse difference, but hydrogen still has a significant advantage, ton for ton. There's more discussion of the topic on this older QA.
However, your question's premise is faulty: pure hydrogen-LOX first stages are a rarity in modern orbital launchers -- Delta IV Heavy is the only operational one I can think of. Much more common is an RP-1 or RG-1 first stage (Soyuz, Falcon 9, Atlas V), or solid rocket boosters paired with hydrogen "sustainers" (Ariane 5, SLS). The reason for this is mainly cost. Hydrogen engines tend to be more difficult to engineer than equivalent-thrust kerosene engines, and very large first stages increase construction and infrastructure costs, while solid boosters tend to be very cheap and compact for their thrust. In the solid-booster/hydrogen-sustainer cases the hydrogen engine functions as a second stage, even though it may be ignited on the ground.
Because the Shuttle set a precedent, and we have spent a generation unwinding that precedent. Or, are still spending time unwinding, because of institutional/fiscal inertia.
The point of the Shuttle was to be reusable, and the fewer stages, the more straightforward was reuse, even if those stages were more complicated . Hence, hydrogen. Due to Nixon’s BoB (Bureau of the Budget), the Shuttle program had its goalposts moved, fiscally. The result was the ~2.5 stage design, with solid boosters as ‘stage 1’ (core stage was actually stage 2 but lit early, as Russell states). The solids had lower upfront cost, and legislators would vote for that.
Shuttle led, most directly, to Energia/Buran, but also Ariane 5 (not Arianes 1-4, which kept LH2 to the upper stage as you noted), H-II, and to lesser extents their Indian and Chinese equivalents. Less directly, Delta IV used LH2 because there was a hydrogen engine available, and someone decided to go for it (where Lockheed Martin and Alliant did not, for their own reasons).
We (…mostly, see below) are now healing from the damage of the Shuttle. First, segmented solids had to go. In particular, H-II solids were never that large in the first place, and their joints were unnecessary cost, mass, failure modes, etc. I suspect/speculate that managers wanted to show segment technology, as ‘keeping up with the joneses’, including national pride. H-IIA then went to short, squat, monolithic boosters to be more competitive- pride has turned out to cost many a person many a million. Ariane 6 will also unwind the mistake of segmented solids… but SLS will not. It will (eventually?) fly more segments, because that will cost many a person many a million more.
Now the core stages… ULA and SpaceX are going to methane fuel because they get it, like you. Blue Origin, too. Ariane 6 will still use LH2, because they won’t spend the money on a totally new engine. Safran figures upgrading is a better deal. SLS keeps LH2, not because they don’t get it, but because ‘it’ isn’t what you think it is. The point of SLS is to keep rich people rich: sending new pork to the districts that had been getting Shuttle pork.