I can't speak for Andrew Ng - but my take is he did out of pure altruism - love. just in terms of advancing free education e.g coursera & the free machine learning courses etc he brought to the masses.
not everyone does things to be rich.