The Philistines in the Bible were generally military aggressors. Goliath was at the head of that aggression. He provoked and tried to dishonor Israel. You could read everything he said about Israel as so much smack-talking, but the fact that he was there to conquer is hard to hand-wave around.
Furthermore, there is much dispute in what gets translated to Philistines, as the wording often referred to Israel's warring neighbors in general.
We often make the mistake of looking at these stories through a modern lens, and ascribing morality to them that simply didn't exist at the time.
Of course, most don't follow Biblical theology, which more or less amounts to "Trust God. He wouldn't have told them to take the Israel if it was unfair." The Philistines taking Israel simply because they want it, in contrast, would be sinful.
> We often make the mistake of looking at these stories through a modern lens, and ascribing morality to them that simply didn't exist at the time.
Right. The "everyone's just conquering stuff" morality isn't accurate either, though.
Remember the context in which this story exists, where it's written and for whom. Goliath is the "bad guy" for two simple reasons.
1) he was a Gentile, and, therefore, unclean in the sight of God, 2) he stood against God's chosen people, and by extension, the will of God.
King David's famous "Slice the baby in half, so that both 'mothers' can have half of it" is clearly a fight of good vs evil. The Evil mother doesn't care for the child, while the good mother cares deeply for the child. And that's how King David solved one child-custody problem... (not actually killing the baby, but by judging the reactions of the two 'mothers' to the potential act).
-----------
The story of "Sodom and Gomorrah" is implicitly about evil. The town faces divine punishment because 10 good people couldn't be found. Its perhaps not "good guy vs bad guy", bit the concepts of "bad guy" are definitely explored.
The whole Bathsheba incident portrays him in a very negative light.