One factor may be that mechanical engineering remains dominated by expensive proprietary software, and the field is largely OK with that. Programming is unique in the sense that programmers can create their own tools, and have adopted an expectation that the most advanced tools should be free and easy to obtain. This culture could easily extend to making the training materials free too.
Another factor is that "coding" is the hot field right now.
Another factor is that "coding" is the hot field right now.