Many do. The downside is that a heavy import tax makes whatever is being imported more expensive for local consumers to buy. In some sense this makes them poorer.
The goal is usually to encourage local firms to grow and compete, and sometimes that happens (e.g. Hyundai). But sometimes the local firms become complacent in their walled garden (e.g. Hindustan Motors).