The unclean spirits beg Jesus to let them enter the pigs. When they do enter the pigs, it does not do them any good. The pigs run off a cliff and die. The unclean spirits are afraid to be cast out entirely, but they cannot be at rest even where they ask to be sent. It was pointless to be put into the pigs, but Jesus does not argue with them. They are self-destructive, and Jesus let them be self-destructive however they want. These unclean spirits are like a person who cannot be free from addiction to a sin like pornography or gluttony. They destroy themselves through their own will.
Then the people of the town beg Jesus to leave. They are above all afraid of this man, Jesus, who can control realities greater than we can see. These townspeople are like a person who wants to live life without religion. Just make money and spend money and forget God. When God comes and visits them, they want him gone as soon as possible. They reject their chance at salvation because of their concern for the things of this earth.
Then the man who has been freed from the unclean spirits begs Jesus to let him follow as a disciple. Jesus refuses his request. He has other plans for this man. He sends him away to preach the Gospel, which means that this man was an Apostle, and we do not even know his name.
It is this way with us. So long as we are self-destructive or worldly, God lets us do whatever we want; there was no point in guiding our foolishness, but when we begin trying to follow God, roadblocks suddenly appear; God is guiding us according to his plan. We can destroy ourselves or ignore God in any way we want, but if we decide to become a disciple, he will be firm with us. “For the Lord disciplines the one he loves, and chastises every son or daughter whom he accepts.”
In the first reading, David is punished for his sin, and he is punished severely. Meanwhile many people commit similar sins and worse yet seem to receive no punishment. It is because it would do them no good. By punishing David, God is saying that he has plans for David, that David is worth preparing for greater things. We do not want God to grant our every prayer. We want God to make us better, even if that means suffering and obstacles.