It didn't take a trillion dollar to develop. The trillion dollar figure includes acquisition costs (going to 2070) as well as operations and maintenance over the same period.
By the way, the F-35 isn't any more expensive than other aircraft. For example for the latest budget proposal (2022), the DoD plans to acquire 85 F-35s [1] for a total price of $85 BN, or about $150 MM per plane. At the same time, it plans to acquire 14 tanker aircraft KC-46 for a unit price of about $180 MM, and 9 cargo helicopters CH-53K for a unit price of $190 MM. Yes, you read that right, those are helicopters, they are not attack, but cargo helicopters, and cost almost $200 MM apiece.
[1] https://www.defense.gov/News/Releases/Release/Article/263871...