In recent years, a lot of parts of the car are of a fixed design, and cannot be changed except for safety and reliability reasons. This includes the engine, the wheels and the main chassis monocoque (the latter is homologated at the beginning of the season). Chassis homologation caused a lot of teams problems in 2011 during the "f-duct" episodes due to teams having to find all sorts of clumsy workarounds to accommodate the ducting for the device without having designed space and openings for it in the homologated chassis.
Even the freeze on engine design (since 2007-2008 ish), has seen things like ferrari spending ridiculous sums to ostensibly improve the reliability of their oil pump, and oh, look at that, as a side effect, gain marginal amounts of engine horsepower.
Racing stresses components to their limit, on purpose, and fans don't like it when races are decided by attrition. So even well meaning attempts to limit development and restrict spending often fail. If someone has the money and the will to gain a slight advantage, it's hard to stop. Even templated designs and string limits on what development is allowed doesn't stop people from spending vast sums of money in search of tiny gains. Nascar is good example of this. While not all the spending is at the individual team level, you have large collectives and manufacturers doing things like designing their own suspension dampers and various engine optimizations. It's still extremely expensive in aggregate.
It seems like you'd need a huge amount of regulation on the teams R&D process to prevent extra money from somehow being spent.