In my view, the important question is whether you
need code protection. It isn't a simple question because the obvious answer "of course I do" might be incorrect if the application itself is trivial.
If all you do is read a bunch of buttons, frame an Ethernet packet and send it down the wire, I can duplicate your project by lunch time without ever seeing your hardware. Designing from bare metal just to get code protection from a project that performs some trivial function is a waste of effort.
In fact, from a long term software maintenance point of view, having a full blown Pi makes a lot of sense. The end user can update the software from a web site. Heck, it could be automated - if the Pi can see the web site, it checks for an update. Everybody does that sort of thing.
Of course, there is the "open source" issue and I don't pretend to understand how that works. You can bet that this will come up at some point since you will almost inevitably be using "open source" tools and libraries. Again, I don't understand how it works. Neither does anybody else!
Because I already have a working project and if Linux brought nothing to the dance, I would tend to use the mbed LPC1768 mounted on a daughter card holding a MagJack and any other project specific hardware but I can see the allure of one of the STM boards. As a fact, I would use the mbed toolchain and libraries for any of the boards they support and many STM boards are included in that list.
https://os.mbed.com/platforms/Here are the boards that support Ethernet and the LPC1768 is at the lower right:
https://os.mbed.com/platforms/?q=&Communication=EthernetOn the other hand, with Linux I get SSH (or Telnet) which may be handy for the user. If there is no need for a console display, keyboard or mouse, the easy way to maintain the system is with a Telnet session and this comes free with Linux.
OTOH, Linux isn't a real-time OS and I don't know whether that matters to your program. If time critical? Can Linux handle it? If not, FreeRTOS is one of the mbed libraries for my favorite LPC1768. But unless I wanted to write a bunch of code, Telnet might be out of the question. I haven't looked at the network stack to see what is available at that level. My application just made a TCP connection to a LaserJet.