Yes, in that application spar varnish would be OK in the same way porch paint would be. The surface isn't covered, it's allowed to breath and dry out, plus you aren't expecting the porch paint to really be a waterproof barrier, only some sort of limited short term barrier to slow the migration of water a little. Once you cover the surface with another waterproof barrier (vinyl), or a water retaining product like carpet, the porch paint becomes irrelevant because it will now be overwhelmed by continuous exposure to water, and even worse, water vapor. The example of porch paint was to show he could do it at a very low cost and still have a long lasting floor, especially if it was removed from the boat and stored in a dry place
The environment under carpet and vinyl isn't that different even though one is waterproof and the other one acts like a sponge. The carpet allows water to reach the plywood in the first instant it's in use, there is no barrier, and once it gets wet it takes a long time to dry. Vinyl protects the wood very well until water is trapped under the floor for a period of time, as the water vapor rises it penetrates the wood and reaches the vinyl and stops, then condenses. It will also find it's way in through any penetration in the vinyl, be it a screw hole, cut, tear, defect, etc. Once there's water between the vinyl and wood the wood will stay wet 100% of the time, that's why vinyl covered wood becomes so heavy, the wood just gets saturated over time.
Paint and spar varnish have a good (fair) degree of water resistance, but they are thin and not really that durable, so for intermittent water exposure they work well, subject them continuous immersion, as in under vinyl or carpet, and they fail quickly. They also need to be redone frequently to maintain the limited amount of water resistance they do have. So if something is painted with either one and then buried below deck where it can't be refreshed with a new coat periodically it becomes ineffective and is of little help in preserving the integrity of the wood.
Epoxy is a very tough and highly water resistant product, it far exceeds the capabilities of just about any other easily accessible coating there is, and by using it the life expectancy of the wood can be extended a great deal.
In my way of thinking there are two ways to approach this type of build, use products that will last a very long time and stand up to the water and abuse for decades (these tend to be very expensive), or use lesser products and make it very easy to remove and replace them (these can be very low in cost and easy to work with). Frequently when using high end costly products there are some very important steps that need to be done exactly right or the entire build can be compromised, like using very good wood, covering it with epoxy and glass, then not sealing a screw hole by mistake. All that time and money spent was compromised by one small point of water intrusion. It may now rot in that area at the same rate it would if there were no protective measures taken at all.
In my boat I wouldn't do the floor in same way again. I would use a different foam, or the same foam in a different way, and then DP AL using Velcro to hold it in place. Right now I can't remove it without a total rebuild, so if something goes wrong it means a great deal of work and money is required to fix it, or even just inspect it. With AL and Velcro I can pull the floor up and inspect it in just a few minutes and be on my way, If it does need some attention it's easy to get to and very low in cost. I will say that it's held up very well for 14 years and is very strong, much stronger than it would be with AL with Velcro, but I don't look forward to the day I need to work on it.