'Out of' in this sense refers to the origin or the source, or the reason for your action.
He offered his assistance not for financial gain, but OUT OF kindness.
This is the original and more literal use of 'out of', meaning 'from'.
It has nothing at all to do with the more modern and colloquial use, as in 'We're out of coffee' (i.e. having none left).