They could use BSD underneath, like JunOS and Netscaler run on.
But maybe an operating system is too large in scope. You're right that these devices only run one application, why use a tool (operating system) that can run many applications?
It's a bit like running a hypervisor for only one operating system. There are benefits, true.
Well, there's the kernel, which handles flinging packets between interfaces, filtering, etc., but your average router has lots of services it provides as well: DHCP, DNS, file/print sharing via USB ports, etc.
Loading even more functionality into the kernel is at odds with security, stability and maintainability. Its also not going to save much/any in the way of resources.
But maybe an operating system is too large in scope. You're right that these devices only run one application, why use a tool (operating system) that can run many applications?
It's a bit like running a hypervisor for only one operating system. There are benefits, true.