This is a very interesting question.
My personal philosophy is Im good as long as I can afford to be good. I plan things ahead and try to think them through. If in doubt I opt for the safer solution unless I can afford going for a calculated risk and the losses I might have can be handled.
I also see my family or my friends and me as one single unit. So I always look at the overall pain and gain. If I suffer a little but someone close to me benefits a lot, then we overall gain something so it makes sense. I expect the same from people around me and Im pretty picky when it comes to people I associate with because of that.
I think being good and doing good is a precious resource that should be wisely used and invested into people that deserve it. Once you do this and pick the people around you carefully you will get the same or even more back and everyone benefits. This is the difference between having positive and productive people around you or toxic people that hold you back and drag you down.
“Good” as in being good or doing good is a construct of our society. Given that almost all humans do what they can and consider best in their situation everyone does good all the time, just not always for others and mostly for themselves (which might have negative consequences for others).
More simple people also often see less options to act or scared people settle for the tried and proven paths because they do not want to be burdened by fear of the unknown along with their general anxiety. So often what appears as someone doing something bad is just a result of their limited worldview or choices that were reasonable for them at that point in time.
Alea iacta est ("The die has been cast")