If the input to the spa panel was on a portable cord with a plug on it, technically it doesn't fall under NEC so leaving a 50amp receptacle on it is ill-advised but not against the code. Once you hard wire, like terminate cables under lugs in a box (anything other than a plug/receptacle connection, it then DOES need to conform to the code. The specific part that isn't code compliant is having a 50amp receptacle on cable that is only rated for 30 but it's not an issue because.....
True that as long as that 4-wire cable goes all the way back to the main panel and both the neutral and ground are terminated on the ground/neutral bus, it CAN properly support 14-30R. However, it is generally advised not to run a dryer on GFCI because it can cause nuisance tripping. I don't have direct experience with it but it comes up in posts all the time. I personally think people are leaving the neutral/chassis bonding wire in place and that will 100% trip GFCI.
The main reason people use a spa panel is that they are often cheaper than the GFCI breaker you'd swap into the main panel. It seems to be converging now though. Spa panels used to be $50 and a SQD QO 240v/30 GFCI was $120. It looks like you can get that breaker for $60 on Amazon right now but you have to look at what brand the panel is.