Check out the "Moral perspectives" section: https://en.wikipedia.org/wiki/Jack_and_the_Beanstalk
I think you're both right, the 1807 version published by Tabart added the moral justification for the killing of the giant which is still common today. But the story may originate in pre-history oral tradition, where it's anyone's guess whether or not Jack is a remorseless violent thief.