This is a false dichotomy. There are following options:
- everything is a file
- do one thing well
- do not work at all on a general purpose OS.
File is an interface (one of) of an general purpose operating system that establishes a bridge between drivers (filesystems, IO devices, network) and user space programs (editors, messengers, music players).
It is a limited and arguably not very universal interface. Unix saying "everything is a file" is a lie, in a sense that operations that it allows to do over a file object are by no means file-like. Unix can send datagrams over file, listen for them, execute a broad set of esoteric commands like "write data and wait for an hardware interrupt".
Windows separates un-file-like operations better, by providing other types of OS handles (sockets, pipes, ports). It still gives some file-like operations to those though.
There is indeed an inherent contradiction between an attempt to implement generic interface for disparate entities and make it work well for a single task.
The current situation (Unix adding strange operations over files and Windows supplying some file-like operations on non-file devices) is the result of a compromise. Too narrow of interface would shift complexity from device driver to user space programs. Too wide interface would shift the complexity the other way. Imbalance would cause one or the other to die out. General purpose OS is tasked with balancing things out, hence suboptimal, but universal solutions.
To really understand how the conflict is resolved, one has to look into real-time or specialized or embedded OS implementations - there compromises are resolved in a different way because no priority is given to broad application of an OS.