Do you think you’d steal food in a mall after you had a nice lunch? What if you were starving for a week and didn’t had any money?
In both scenarios your net gain is the same. What you’d be stealing is the same food, but in the first scenario your physiological needs were satisfied. This means that you value the same thing differently depending on how you are.
Maslow’s hierarchy of needs is a hierarchy on how we need to fulfill some needs before we want to fulfill others. Sometimes we can try to fulfill several needs in parallel, but usually we will prioritize the base of the pyramid, before moving on to higher needs.