Why is free trade within a country good but not when it crosses some arbitrary line around a "nation"?

The answer is that free trade is good due to the principle of comparative advantage. It makes no difference whether your trading partner is on the other side of an arbitrary line or on the same side. Taken to the extreme, we would have to produce *everything* by ourselves instead of specializing and trading with others if we weren't allowed to trade freely with others.