Real Madrid's squad includes Courtois (a fairly priced goalkeeper at 40m), Sergio Ramos (an expensive 27m transfer who has been at the club for 16 seasons), Varane (10m, 10 seasons) Marcelo (6.5m, 15 seasons), Mendy (50m), Militao (50m), Nacho (zero), Odri and Carvajal (6.5m buyback fee from initial sale, so 1.5m) in defense. In the midfield they have Luka Modric (fairly priced at 35m, Balon D'Or winner while at the club, still going), Toni Kroos (25-30m), Casemiro (10-20m or something it's kinda confusing), Valverde (5m) and Isco (slightly overpriced at 30m). In attack they have Benzema (quite expensive at 40m, has been at the club for over a decade now and is close to being a club legend), Asensio (4m), and Vinicius / Rodrygo (insanely overpriced at 45m).
Their net spend over the last 12 years (the Ronaldo summer) is 499m. I don't know how 12 years compares to other clubs, but this article from December 2019 says that the 10-year net spend of Real Madrid at the time was 9th overall, 75m higher than Bayern Munich, and below Arsenal, Juventus, Chelsea, AC Milan, Barcelona, Manchester United, PSG, and Manchester City.
These purchases funded 4 Champions League titles. The club is currently defending a league title and in the semifinals of the Champions League, with Militao and Vinicius being star players in the CL and Clasicos, the most important games of the season so far.
Mistakes have been made and some players have been overpriced and some have been total flops, but Real Madrid has one of the best transfer records of the last decade. For every flop, I can find you one cheap guy and one fairly priced guy who helped the club win Champions League trophies. With all due respect to Marquinhos and Verratti, they have won the exact amount of CLs for their club that Militao and Vinicius have won for theirs: zero.