I have been running pure Debian for years on my router/home server. Ubuntu is a superset of Debian that mostly adds stuff that is irrelevant for a networking device. Just stick to base distributions unless you are a very good reason not to.
Ubuntu made more sense when you installed end user apps from the apt repos and wanted updates more than every 2 years. These days with Flatpak you are better off on Debian.