It was around the time I was in university that Python really matured for numerical computing, but professors (as opposed to grad students) were likely to be already familiar with Matlab, so there wasn't much reason for them to learn Python. Andrew Ng was already a mid-career researcher when he made his course, which was probably based on older materials (I also learned basic neural networks in my numerical computing class in 2008), so it made sense for him to continue to use Matlab, especially because Octave exists as an open-source reimplementation of the basic functionality.
These days, you wouldn't use anything else but Python for ML, at least until you really productionize the implementation at a large scale, at which case you might rewrite in C++ or Rust (I don't know if they even bother rewriting these days when most of the computation happens in GPUs or TPUs). And it's my understanding, although I'm not really too familiar these days, that Matlab has mostly pivoted into providing a toolbox of all sorts of esoteric numerical methods for engineering-related tasks like finite element analysis, as well as hardware simulation (using Simulink).