Everything is a transaction at the simplest level. You have friends because it makes you feel good. You wouldn't keep them if it made you feel bad would you?
You give because you think it's right and when you do something right, it makes you feel good.
I do agree with you that everything would be so much better if everyone went around giving but in this world not everyone does. Since some cheat, the fairest is to deal in transactions.
Or my favorite thought of the day.
If I have but one life to live, why not live for me?