The two passages are discussing quite separate matters. The key to understanding Matt 12:43 is the important word, "rest" which is deeply significant in the Hebrew psyche.
Rest
In Ruth 3:1, Naomi wants Ruth to find מָנוֹחַ (monoach), a resting-place, state, or condition of rest (BDB) or security. She does this by hatching a plan whereby Ruth proposes marriage to Boaz. Ruth finds security and rest by seeking the protection of “go'el”. This idea is taken up in many other places such as:
- Deut 12:9 – For you have not yet come to the resting place and the inheritance that the LORD your God is giving you.
- 1 Kings 8:56 – “Blessed be the LORD who has given rest to his people Israel, according to all that he promised. Not one word has failed of all his good promise, which he spoke by Moses his servant.
- 2 Chron 6:41 – Now therefore, arise, O LORD God, and enter Your resting place, You and the ark of Your might. May Your priests, O LORD God, be clothed with salvation, and may Your godly ones rejoice in goodness.
- Lam 1:3, Israel in captivity has no rest and needs a redeemer.
- Ps 95:11 – “So I swore in My wrath, ‘They shall not enter My rest.”
- Heb 3:18-4:11 – the Hebrews did not enter God’s rest because of disobedience but there still remains a Sabbath rest (and security) for the people of God
- Matt 11:28-30 – Jesus invites us to enter His rest and salvation security
Back to Matt 5:43 and Mark 5:12
Thus, the idiom of Matt 12:43 is of an unclean spirit (ie, demon) looking for a well-watered place to find a permanent home. That fact that it find only "water-less" places means that no permanent home (another person) was found. Thus, it returned to the original person.
In Mark 5:12, 13 - the demons destroyed the pigs, a highly valued commodity in a pagan (non-Jewish) place like Gerasenes. That is, the demons tried to alienate the people from Jesus (it worked as they asked Him to leave the area; BUT, the ex-demon-possessed man became a very effective witness for Jesus subsequently.
The Jamieson-Fausset-Brown Bible Commentary suggests this:
- Send us into the swine, that we may enter into them—Had they spoken
out all their mind, perhaps this would have been it: "If we must quit
our hold of this man, suffer us to continue our work of mischief in
another form, that by entering these swine, and thus destroying the
people's property, we may steel their hearts against Thee!" ...
- And forthwith Jesus gave them leave—In Matthew (Mt 8:32) this is given with majestic brevity—"Go!" The owners, if Jews, drove an
illegal trade; if heathens, they insulted the national religion: in
either case the permission was just. And the unclean spirits went
out—of the man; and entered into the swine: and the herd ran
violently—rushed down a steep place—down the hanging cliff into the
sea (they were about two thousand)—The number of them is given by this
graphic Evangelist alone and were choked in the sea—"perished in the
waters" (Mt 8:32).
- And they that fed the swine fled, and told it—"told everything, and what was befallen to the possessed of the devils" (Mt 8:33). in
the city, and in the country. And they went out to see what it was
that was done—Thus had they the evidence, both of the herdsmen and of
their own senses, to the reality of both miracles.