I think the answer is that, they thought foreigners will have a bad influence on the people if allowed in. So they made a closed country policy. Almost all the ports were closed.Only Nagasaki was open and to only Dutch and Chinese merchants.
This was so because when the Europeans started arriving, they were received by the daimyo or landowners and the merchants but when they settled, they shunned their traditional beliefs and started getting involved in local politics.