One needs little Biblical evidence to show that the demons always were working against Christ--that is well understood. The temptations Christ experienced during his fast in the wilderness (Matthew 4, Luke 4), however, show how severe the conflict between Christ and Satan was.
It is also true that Satan is the enemy of mankind, and wants to hurt and destroy wherever possible. Speaking of the devil, Jesus said:
"...He was a murderer from the beginning, and abode not in the truth,
because there is no truth in him. When he speaketh a lie, he speaketh
of his own: for he is a liar, and the father of it." (John 8:44)
In keeping with this fact that Satan was both a murderer and a liar, his request to enter the pigs was both deceitful and murderous. The keepers of the pigs would have been trampled by them, or caught up in the stampede to end up in the lake themselves, had not Christ especially intervened to keep them out of the demons' power; yet it had been the demons' purpose to destroy those men along with the pigs.
But the demons had a second purpose in mind: They knew how much those pigs meant to their owners, and that if the pigs should be destroyed, it would generate animosity against Jesus which would prevent him from teaching the people in that region, "the country of the Gadarenes." (Mark 5:1). [Note: "Gadarenes" and "Gergesenes" (Matthew 8:28) are in essentially the same place. See HERE for more.]
While Jesus frustrated their designs to end the lives of the pigs' keepers, he allowed the demons to destroy the pigs because the Jews who kept them should have known better than to raise unclean animals for market. The swine were not to be eaten according to the laws of health given in the time of Moses.
"And the swine, though he divide the hoof, and be clovenfooted, yet he
cheweth not the cud; he is unclean to you. Of their flesh shall ye
not eat, and their carcase shall ye not touch; they are unclean to
you." (Leviticus 11:7-8)
"And the swine, because it divideth the hoof, yet cheweth not the cud,
it is unclean unto you: ye shall not eat of their flesh, nor touch
their dead carcase." (Deuteronomy 14:8)
God could not approve of the consumption of pigs' flesh, and the pigs were not protected from the demons' power.
While the demons seemed, for the time, to gain the upper hand in causing the people to send Jesus away, Jesus knew that the men he had freed from bondage would be tell their story in such a convincing manner that he would have another opportunity erelong.
The demoniac who had wished to follow Jesus, though not permitted to stay with him, preached the gospel afterward, as the Bible records:
"And he departed, and began to publish in Decapolis how great things
Jesus had done for him: and all men did marvel." (Mark 5:20)
It was after the stormy night on the sea, when Jesus walked out on the lake to his troubled disciples, that he once again visited that place. As the Bible says:
"And when they were gone over, they came into the land of Gennesaret.
And when the men of that place had knowledge of him, they sent out
into all that country round about, and brought unto him all that were
diseased; And besought him that they might only touch the hem of his
garment: and as many as touched were made perfectly whole." (Matthew
14:34-36)
[Note that "Gennesaret" is used also as a name for the lake (Lake Galilee) and can refer to a fertile region around the lake, not merely to the side opposite Gadara. See Luke 5:1.]
Clearly, the people of that region remembered him; and this time they were happy to come to him. Quite possibly, the incident with the pigs had actually served to increase his fame, though it took a little time for the initial prejudice against him to be removed by the witness of the men miraculously freed from bondage.