Free trade is a good thing. Paul Krugman, who got a Nobel for being the biggest name in The New International Trade with its idea that economies of scale meant tariffs could benefit a country, wrote a good article on the importance of the basic ideas in economics, and one of his examples, I think, was that tariffs are still mostly a bad idea. The strongest reasons, though, are (1) government failure and the protection of special interests, and (2) that when retaliation happens, everyone is worse off.
If we put those aside (the big If for policy purposes), there are six reasons why tariffs can be a good idea:
1. They raise revenue like any tax, and collecting that tax has low transactions cost, something especially important for undeveloped countries.
2. If you are a "large country" (a term of art in international trade), then you have market power and the tariff will change the terms of trade in your favor. This is the standard, anciently known, reason, that economists don't like to talk about.
3. The New International Trade reason: you can use tariffs to capture a natural monopoly for your country in a particular industry such as airframe manufacturing or computer operating system software. This is a very special reason, and one easily abused by special interests.
4. The very old reason that autarky keeps the country safe from the threat of disruption during war or just from blackmail in peace because it isn't dependent on foreign countries.
5. A New New International Trade reason that I haven't heard before: that if you are a "small country", if you have some unusually high-productivity companies, they have market power, and you can maybe benefit by using export tariffs to magnify their market power. I need to work on this or look out to see if somebody else has worked it out.
6. The idea from my paper with Myatt that everybody has market power over their own demand. Even a "small country" is the only source of its particular demand for products, and so can benefit from import tariffs (as long as there is no retaliation).
I should develop this into an essay.