From Matthew Henry's Commentary:
The parable represents his possessing men’s bodies: Christ having lately cast out a devil, and they having said he had a devil, gave occasion to show how much they were under the power of Satan. This is a further proof that Christ did not cast out devils by compact with the devil, for then he would soon have returned again; but Christ’s ejectment of him was final, and such as barred a re-entry: we find him charging the evil spirit to go out, and enter no more, Mark 9:25. Probably the devil was wont sometimes thus to sport with those he had possession of; he would go out, and then return again with more fury; hence the lucid intervals of those in that condition were commonly followed with the more violent fits. When the devil is gone out, he is uneasy, for he sleeps not except he have done mischief (Prov. 4:16); he walks in dry places, like one that is very melancholy; he seeks rest but finds none, till he returns again. When Christ cast the legion out of the man, they begged leave to enter into the swine, where they went not long in dry places, but into the lake presently.
[2.] The application of the parable makes it to represent the case of the body of the Jewish church and nation: So shall it be with this wicked generation, that now resist, and will finally reject, the gospel of Christ. The devil, who by the labours of Christ and his disciples had been cast out of many of the Jews, sought for rest among the heathen, from whose persons and temples the Christians would every where expel him: so Dr. Whitby: or finding no where else in the heathen world such pleasant, desirable habitations, to his satisfaction, as here in the heart of the Jews: so Dr. Hammond: he shall therefore enter again into them, for Christ had not found admission among them, and they, by their prodigious wickedness and obstinate unbelief, were still more ready than ever to receive him; and then he shall take a durable possession here, and the state of this people is likely to be more desperately damnable (so Dr. Hammond) than it was before Christ came among them, or would have been if Satan had never been cast out.
The body of that nation is here represented, First, As an apostate people. After the captivity in Babylon, they began to reform, left their idols, and appeared with some face of religion; but they soon corrupted themselves again: though they never relapsed into idolatry, they fell into all manner of impiety and profaneness, grew worse and worse, and added to all the rest of their wickedness a wilful contempt of, and opposition to, Christ and his gospel. Secondly, As a people marked for ruin. A new commission was passing the seals against that hypocritical nation, the people of God’s wrath (like that, Isa. 10:6), and their destruction by the Romans was likely to be greater than any other, as their sins had been more flagrant: then it was that wrath came upon them to the uttermost, 1 Thess. 2:15, 16. Let this be a warning to all nations and churches, to take heed of leaving their first love, of letting fall a good work of reformation begun among them, and returning to that wickedness which they seemed to have forsaken; for the last state of such will be worse than the first.