Whenever humans pull scripture apart and try using their human reasoning with it, there are differences of opinions because it is humans doing it. If God plainly says so, then we are to know. Lots of things in the bible is not plainly described, meaning that we don't need to know. If people disagree about what it says, one of those people is wrong.
So with the story of the pigs. There are certain facts about God that are there, and we can know that our knowing about how he handled the pigs is not to be used to cancel those facts. God is love. God wants shalom for His people. God does not want His people to be possessed by demons. So learn what God is telling you, and know you can't know all that God knows. If God felt you needed to know the economic position of the pig owners, who they were, how losing their pigs affected them, or any of that God would have told you. If this shakes your faith in the ability of God to run His world with shalom, then your faith is very frail.