Why is it still common to use raw sockets such as tcp and udp?
Because of time. Raw tcp
and udp
communication protocols have "made it" into a common standard ( bearing all obligatory compatibility promises since then ).
O/S-es, hardware devices, even MITM-sniffers rely on them for having all those RFC-standards documented properties.
While ZeroMQ and other frameworks offer higher layer abstractions atop of these underlying standards, the also need the rudimentary standards to keep the promised compatibility.
... why this has not become part of the operating systems themselves?
O/S-es, for obvious reasons of accumulating minimum overheads, occupying minimum space and for similar reasons preferred since ever, currently prefer and will prefer to re-use mature public domain standard tools, i.e. no proprietary or license-restricted tools with unknown (un)supported cross-compilation compatibility. So no bottom-up, industry-wide total re-engineering will most probably come in any near future ( at unknown costs and lead-times till mature enough, if eventually the industry happened to decide, in spite of the above, to start and survive in doing that ).