2. The Cardinals were concerned about his velocity and walk rates.
John Mozeliak traded away Jordan Hicks last trade deadline due to his expiring contract. The franchise needed to replenish its farm system, and Hicks was an easy trade target for opposing teams. When they traded away Hicks, the team lost quite a bit of firepower in the back end of the bullpen.
In order to replace Hicks, perhaps the front office is looking at other flamethrowers such as Aroldis Chapman or Hector Neris. Yuki Matsui averaged just under 92 MPH on his fastball last year, so he won't exactly blow away batters. He also employs a split-finger fastball heavily, and the larger baseball in MLB could be a tough transition. Redbird Rants' J.T. Bucheit discussed this in his article discussing his concerns with Matsui.
Another concerning aspect of Matsui's game would be his career walk rate. His 2023 walk rate was substantially lower (5.9%) than it has been for his career (10.9%). He may have made an adjustment, but a career walk rate near 11% is significant, especially for a bullpen that walked the 16th most batters in baseball last year.
3. The Cardinals wanted to avoid a long contract.
A five-year deal to any relief pitcher is risky business, especially a five-year deal to a player with no experience in Major League Baseball. The Cardinals have been bitten by lengthy reliever contracts in the past (see Brett Cecil), so it is understandable that they would want to avoid those mistakes again.
Matsui's contract keeps him in San Diego from his age 28 through his age 32 seasons. Those are prime years for a pitcher, even a reliever; however, relievers are volatile regardless of their history (see Andrew Miller, Greg Holland, and Brett Cecil again). It seems more likely that the Cardinals sign a reliever to a two-year contract, as they have been apt to do just that in recent offseasons.
St. Louis could have offered Matsui similar opt-outs after years three and four, but those opt-outs are in the hands of the player, not the team. The contract could have turned into a three-year deal but only if Matsui were playing well enough to want more money in free agency down the road. If he didn't succeed, he would more than likely decline the opt-outs and take the guaranteed money.
I'm not sure if Matsui would have taken fewer years and a greater AAV, but that could have been possible for the Cardinals. Even a three or four-year contract worth $25 million would be achievable from the Cardinals' financial perspective.