The population density of Italy 201/km2 is lower then population density of Germany 241/km2, so from point of view of density, Germany should have more high-speed rail than Italy.
That would be if kilometers of rail tracks scaled linearly with population density per unit area. My guess (based on no research at all) is it’s more that there’s a population density tipping point, and after reaching it rail development dramatically increases. I do also think you’re right about the influence of the German car industry.