There’s a couple factors, a lot of which boil down to the intersections between culture and warfare, but technology is also involved.
First, we have to talk about technology. For most of their history, Rome did not have access to the stirrup. Without stirrups, mounted combat is extremely difficult – any time you swing or hit with your weapon, or are hit in turn, you risk falling off your horse. It’s not impossible to fight without stirrups, but it takes a hell of a lot more training because you have to learn to grip the horse with your legs in time with your attacks and defenses.

For most of their history, Romans simply preferred to spend their time training in some of the best infantry drills the world had ever seen – which after all, had allowed them to conquer almost all of what was the known world – and subcontracted out their cavalry to auxiliaries from places, like Numidia, that had invested their time in perfecting the difficult art of pre-stirrup mounted combat. Think of it like a military version of comparative advantage.
And then when the Eastern Roman Empire managed to survive the devastating invasions of the 6th century, they did something amazing: they changed their entire way of warfare on the fly. They borrowed the tools of their enemies – the recurve bows favored by the Huns and the Persians and the stirrups of the Avars – and used them to construct a highly-trained, well-equipped professional mounted soldier armed with both bow and lance (and sword and axe and mace) whose skill and flexibility could offset the Byzantine’s perpetual manpower disadvantage, and redesigned their tactics and strategy around them.

Next, we have to talk about culture. For most of the early Republic, soldiers were expected to provide their own arms, and horses were incredibly expensive. So expensive that there was an entire Roman social class right below the senators called the equites, whose status derived from the fact that they had enough money to equip themselves with horses. Thus, Roman cavalry was always going to be a minority affair, because most of their soldiers simply couldn’t afford horses.

Once Rome shifted to a professional military, the cost transferred to the state and Romans had a very large military indeed. (Consider the Battle of Phillipi, where as many as 400,000 soldiers took part) Mounting this number of men would have been incredibly expense, and before the advent of the stirrup wouldn’t have seemed worth the effort, when Roman foot soldiers were just as effective and far cheaper to equip and maintain.
Now, this gradually changed for a couple reasons. First, as the empire expanded, Rome came in contact with more and more peoples who fought on horseback, first expanding their auxiliary forces and later on (as those people were gradually Romanized) their own cavalry forces. Second, as the empire expanded, foot soldiers couldn’t adequately defend extended borders against fast-moving mounted invaders. So the Roman army had to change. The relatively slow and quite expensive Roman legion was abandoned in favor of a new system that divided the military between the numerically larger limitanei (who guarded border fortifications and acted as a first line of defense against invasion) and the elite comitatenses (the mobile field armies stationed in the interior who could be scrambled to fight invasions that had gotten past the limitanei before the invaders could reach major cities).
Given this division of labor, you increasingly got specialization whereby limitanei were most useful as infantry and
comitatenses were most useful as cavalry. So even before the advent of the stirrup, there was already movement in the direction of emphasizing cavalry, simply due to the need to protect longer and and longer borders.