Deep in the article:
it should be noted that since the first half of the twentieth century, Costa Rica has entrusted its defence to the United States, directly or indirectly.
Easy to give up spending money on defense when someone else is willing to spend a LOT of money to defend you.