Foreign trade could cause farmers income to fluctuate a lot. In some years farmers could lose because of cheap imports and fall in prices of farm products. So the exports ad imports should be banned.
Small farmers will not be able to bear this loss. They will get caught in debt trap and become poorer. So this ban helps the Indian farmers in preventing them from debts and heavy losses.