Solaris 8, 9 or 10 would be the OS to run on one of these if you want something period correct and matching the oddball hardware. If you want to use it for something practical (i.e. have it accessible online), NetBSD is the modern OS to go for.
In any event it's good to have the fastest CPU and a decent amount of RAM. Solaris never really flies, but this is about as good as you can get it for Solaris 9. For 10 you should consider an upgrade to 512MB. Getting a bit rusty on my Sparc lore, but if you want to run a SunPCI card, that will determine OS version. The original SunPCI (with K6-2) is supported up to Solaris 8. You can get it to run on 9, but it's non-trivial (I did that for no good reason about 20 years ago, don't ask me how). The SunPCI II is supported up to Solaris 9 and SunPCI III can run on Solaris 10. I don't think the combination with the Ultra 5 is supported though.
Interesting tidbit: earlier Sun systems were heavy stainless steel chassis tanks, but these systems marked the point when Sun outsourced it to Taiwanese ODMs, more specifically Mitac, who also built for the likes of Compaq and Packard Bell at the time. This use of consumer-grade manufacturing was panned in a similar way to the PowerMac 4400. However, this has one big advantage a few decades on: Sun used coloured plastic on earlier SparcStations that has deteriorated to the point of crumbling (the purple bits on SparcStation 5 and 10, for example). Mitac used more generic ABS which has yellowed terribly - but retains much of its structural integrity.