I think it depends on the priorities set by the country. I mean throughout the 50s and early 60s, Indonesia was an impoverished country but the focus at that time was confrontations against the Dutch and British. So it possessed strategic bombers, long range AA missile, cruisers and submarines.Even Indonesia with it's Trillion dollar economy doesn't have Tor , Pantsyir and S300
Nowadays Indonesia focuses more on its economy. Its defense budget accounts for less than 1% of its GDP yet it is spending hundreds of billions in infrastructure. If Indonesia spends 4-5% of its GDP for defense, that alone would be around 40-50 billions usd, surely TOR and S300 will become affordable at that point.