I've pushed back in the past about the M series demise, but with the frequency of announcements, I've mulled it over for longer . Sorry if this duplicates what others have said earlier....
TL;DR - The M is a casualty of economics but this is a play for a larger market - their existing (non M) APS-C base (Rebel and 7D).
As we know, lenses take 2-3 years from design to release, and bodies are perhaps a little bit shorter but not much. I would guess that Canon's R strategy was created 4-5 years ago, and the M series allowed them to experiment on what would and would not work. I'm guessing 2+ years ago they decided that the M range would not be continued, and the M6 II was a last attempt to squeeze a bit more out of it whilst they tried the same with the 90D, and not an ongoing commitment to the M range. But in releasing it, they may have kept you away from competitors for a little longer unless you sell your M gear in annoyance. Similarly, the R and the RP were attempts to shore up people moving. Both these moves show that Canon is not always perhaps as decent as we might like to think, and in the shrinking market they cannot allow buyers to decide...
Despite its success in terms of sales volumes and its contribution to Canon's market share (which is clearly important), Canon knew what margin they were making and based on the number of resources required to achieve this. Looking at the market erosion, they deemed those resources should be concentrated on more lucrative developments at the "expense" of market share, leaving Fuji, Panasonic and Sony to determine the viability of the "M" segment of the market. And in hindsight, I think they concluded this a couple of years ago as per above. In time, Canon's decision will inevitably lead to a reduction in resource requirements when they achieve a level of market saturation with their new range. But it maintains profit and thus keeps the share-holders happy. What impact it has on market share in a shrinking market may not be as significant as we might hope (for them to change their minds).
There will be some economies of scale in terms of a single body range (for Canon), some benefits to end users of a harmonized set of accessories, but the single body range will not provide what the M did in terms of price/performance/weight/size. Whether it provides sufficient for some M users to convert remains to be seen (unless you actually register all your equipment with Canon, I'm not sure where they can get that information from).
For those M users, like myself, who were attracted to that combination of p/p/w/s it is very simple - just as anyone with a dSLR can confirm, the M range will continue to take good pictures for many years to come. I personally will probably pick up another M6 II and I think that will satisfy me for a significant time. My 10D still works, and although the construction on the M range is not as robust, I suspect the innards do have a similar quality to them. I have R bodies, so an APS-C in an R body has potential appeal for wildlife but I doubt it will cause me to sell my M gear.
For existing APS dSLR users who have not migrated, it will be interesting to see if there are sufficient compelling features or pricing for them to change. I would expect Canon to be reasonably aggressive to lure the two "APS-C camps", and taking your lenses with you (like many of us who have EF or EF-S lenses did) will "reduce" the cost effect and hence why there will be no APS-C R lenses - it's a play to keep you in the Canon ecosystem, and over time a APS-C users may even supplement with an RF lens or two, and then a FF body. If you don't well then you're Again, without people registering their kit, I am not sure where Canon can know this.
The casualty of the M is economics - as per my 4th paragraph. I do not believe these new bodies are aimed at M users. It is disappointing for a lot of people who have no interest in larger bodies, but alas I think they have concluded that purchasers of the M system are no longer as important to Canon's future. You'll be supported just like the dSLR camp and EF camp who were told similar things last year. It will be interesting to see if they make an announcement about focusing on R and not active on M just like they did with the EF...