The story makes sense (in context) because of animosity between Jews and Samaritans, going back many years. A modern equivalent might be a Trump supporter helping out a democrat, or a Russian helping a Ukrainian.
John 4:9 gives a good illustrates this situation. In that story, a Samaritan woman is surprised that Jesus would talk to her when he is a Jew. It also illustrates that Jesus very much went against the culture of the day in his relations with Samaritans.
So, Jesus' wasn't making a statement about whether Samaritans were good or bad - he was explaining that being someone's neighbour is about how you treat them, not who you are. A modern parallel might be the famous 'today you, tomorrow me' story on reddit.