Because relying in color to convey messages is not a very good idea. Also, it leaves room for confusion. For example, let's say your primary color is red... which color would you use for an error if red is the color of your CTA?
On that page you mention, see what it says about colors:
Color
Error text should reflect your product’s color palette. It’s recommended that you use a contrasting color for error states, such as
a warmer hue like red or orange.
Error text should be legible, with noticeable contrast against its background color.
As you may see, you can use color FOR TEXT. However, block elements are a different story.
So, while color is still used sparingly for form messages, it's better if you avoid it on block elements, specially buttons. Instead, Material suggests an element based approach to transmit warnings and error messages. These elements can be inline messages (like those shown on forms) or they can be any kind of dialogs, like snackbars, alerts, bottom sheets, empty states and so on.
If you visit those links, you'll see how Material gets rid of color in favor of a content+context approach, displaying the most appropriate kind of message (warning, error or alert)
Finally, what Izhaki said: while there are uses for a warning, are you sure you need them? Most of the times I see a warning is incorrectly used and serves to no other purpose than to create friction