I think when they say dont write for money they mean don't make it your main priority because it takes a long time before you start to earn anything worth while and if money is your only driving force then there's a good chance you're gonna quit pretty soon.
If you write for the love of writing and have money as a secondary motivation then you're much more likely to succeed.