A decade ago, I might have suggested Ubuntu because it seemed like a lot of the open source GIS development was taking place on Ubuntu. It ran fine on RedHat derivatives; it was just a little easier to get running quickly on Ubuntu. However, even then that was probably more true for QGIS and friends than the server side stuff.
Fedora and Ubuntu would both be perfectly adequate. Part of it depends on what makes you most comfortable. If you ever plan to deploy this for someone else, though, it's a good idea to find out what environment works best for them.
If this is primarily (or even partly) about learning, stick with the OS you're familiar with and concentrate on just learning the tools. If your primary interest is using the tools, you might go with the suggestion from @key -- begin with one of the containers. On the other hand, if you really want to know how the pieces go together, there is no substitute for installing those pieces (PostgreSQL, PostGIS, Tomcat, Geoserver) one piece at a time and fitting them together.
(Full disclosure: Xubuntu is my daily driver and Ubuntu server is what we use at work.)