In this case "lo" refereslo
refers to "el dinero"el dinero
as in English you say for example "I ate the cake" or:
I ate the cake.
Or you can say "I ate it".:
I ate it.
In English you say money isn't everything -- > it isn't everything.:
Money isn't everything (It isn't everything).
Hope you understand my explanation.