Some people preach or teach that even though David and Goliath were real, "David represents you and Goliath represents the obstacles in your life." I have heard/read "preaching" like that.
I'm sure somewhere there are people who "believe the parts of the bible they like" who think the account of David and Goliath is "just a story with a deeper meaning."