So implementing this in the compiler would entail some fairly involved handshaking between the code and the compiler beyond the normal scope of C/C++. Doing this in a library instead — and leaning on a well-understood and well-studied execution model — makes everything a bit more natural to work with.
It's wasm2c job to ensure that the C generated enforces the WASM memory rules, so I'd say the one sanitizing the code is not clang but wasm2c.
It's a stack machine with a limited set of operations, no direct control over the stack/control flow and restricted access to memory.
It's way easier to compile this limited set of operations to assembly (or C) that is guaranteed to not do things it shouldn't.
Because they want to compile arbitrary code in order to sandbox it.
The alternative is something like eBPF, but that imposes a limited subset of the source language, which would be unlikely to work with something like a video decoder.