First of all 'YouTube' is considered a platform - a digital system on which something else can be built (ie your personal channel is created on the YouTube website). Just as with a literal, physical platform, anything built on top is "on" that platform. So, your channel is 'on' YouTube, and you are making money whilst 'on' that platform.
However, 'YouTube' is also a brand name. I believe it is ultimately owned by Google, but so that this answer can be applied in a broader sense, let's say that 'YouTube' is the company behind the platform. If you said you were making money 'with' YouTube that could mean that you were in partnership with them, which you are not. They may well be making money from your channel too, but it is a kind of pyramid, not a partnership.
It seems correct to say that you are making money "on" YouTube.