Arcana Coelestia # 9344
9344. 'You shall not make a covenant with them and their gods' means no contact with evils and falsities. This is clear from the meaning of 'making a covenant' as being joined together, dealt with in 665, 666, 1023, 1038, 1864, 1996, 2003, 2021, 6804, 8767, 8778, thus also being in contact with, for people who communicate with one another are joined to one another; from the meaning of the inhabitants of the land, to whom 'those with whom they were not to make a covenant' refers here, as evils, dealt with just above in 9342; and from the meaning of 'their gods' as falsities, dealt with in 4402 (end), 4544, 7873, 8867, 8941.
Arcana Coelestia # 4544
4544. 'Remove the gods of the foreigner which are in the midst of you' means that falsities were to be cast aside. This is clear from the meaning of 'removing' as casting aside, and from the meaning of 'the gods of the foreigner' as falsities; for in the Word 'gods' means truths and in the contrary sense falsities, 4402. Those people were called 'foreigners' who were outside the Church and therefore those who were subject to falsities and evils, 2049, 2115; and this explains why 'the gods of the foreigner' means falsities.