Why institutions and governments invest in infrustructure instead of hiring researcher permanently?
Even though collaboration over distance has become more and more easy due to technology, it is that researchers like to meet. Really, they do. And especially, they like to meet at nice places. I am pretty sure that places like Princeton would not have attracted all these great minds over a long period of time if it has been an unpleasant and crammed place.

Similarly, researchers still like to have offices.

Besides this, there is also politics: It is much simpler to allocate a fixed amount of money for one greater expense than to allocate a yearly budget. This is what I observe in my country. We see a lot of programs where a fixed amount of money is given for a specific purpose which has to be spent in a limited amount of time ("Hochschulpakt", "Exzellenzinitiative", "1000-Professoren-Programm", "Digitalisierungsoffensive") and this is often used to fund temporary positions. but it is really rare that the government actually raises the base funding of and institute to hire more permanent researchers.

Finally, the number do not really add up. You can build a decent building for, say, 10,000,000 (Dollars, Euros,…), but considering that a researcher costs (very) roughly 100,000 a year, the building only pays 100 year of research, so can have enough money to pay about 3 or 4 young guys for the rest of their careers.