I saw it differently; that at the time their society was more interested in maintaining internal stability than defending against foreigners. The cost of letting the 47 live is a breaking-down of the social mores that enforce obedience to superiors. The cost of losing the 47 is fewer men to defend Japan. The Shogun was from the start interested primarily in stopping feuds, preventing internal struggle.
Although that doesn't make sense because Japan was effectively being attacked by mercantile imperialism from Europe. You'd think you would want a strong military.
But perhaps the Shogun felt politically threatened by the breaking-down of existing social mores against which he had no control. The rise of foreign influence on Japan, the power of individuals, and the slow destruction of the Samurai as a social class. On one level perhaps the decision to let the ronin die was partly to get them out of the way and help balance power among the provinces. After all they had just killed how many hundred of the Ice Guy's men? On another level perhaps we can forgive irrational or shortsighted decisions. And on another perhaps there was nothing else he could do, bound himself by tradition.
Then again I don't actually know enough about Japanese history to make this kind of commentary. I'm kinda talkin' outta my ass here.