MATLAB can generate C code for ARM Cortex-M

Yes, you are right but there are free trial versions. All software is expensive. Discussing about software packages costs makes sense when indeed one uses things like Matlab coder ($6500) for making profit.

The Arduino IDE isn't.