In case one has never worked with ZeroMQ,
one may here enjoy to first look at "ZeroMQ Principles in less than Five Seconds"
before diving into further details
Q : "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 'em 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.
Q : " ... 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 similarly motivated reasons preferred since ever, currently prefer and will prefer for a foreseeable future to re-use mature public domain standard tools, i.e. no proprietary or license-restricted tools with unknown or unsure how long (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 so far said, indeed to start and survive in doing that ).