The initial reason for both, I suppose, was the ownership mandate to cut payroll after the pandemic. Even the Arenado trade needed the Rockies' underwriting to get done.
But once the season got going, there were plenty of affordable upgrades tp be had for bench help. The Giants and Brewers both did a great job of adding on the fly.
The initial problem with pitching was the erosion of depth in the organization, thanks in large part to the trades for Ozuna, Goldschmidt and Arenado. The Cardinals spent a lot of capital in those trades. In the past the Cardinals had plenty of young arms backing up their big leaguers. This year they did not have such an army -- then they became vulnerable when the injuries and reinjuries took a toll.
Mozeliak did eventually add several useful pitchers on the fly, starting with LeBlanc and continuing with Garcia and McFarland for the bullpen and Happ and Lester for the rotation. The trade market had more options in July than in June when the Cardinals' sprung their leak, but the failure to find help earlier proved costly.