Is if safe/legal for an aircraft to return to cruising altitude after passenger oxygen masks have been deployed?
Once the masks have deployed and any of them have been activated, you no longer have an emergency oxygen supply for all the passengers. Not having that, going above FL250 (may vary in jurisdictions besides the FAA) is not allowed. Up to 250, emergency O2 isn't required for the passengers, since you could descend quickly enough to a safe altitude in the event of a depressurization. Above that, though, having the masks available (and no, hanging down doesn't quite count) is required, both for legality and for safety.

To climb back up to a cruise altitude in the 30's is a pretty significant misjudgement, given the facts as they've been presented to date (which may have significant mistakes in the reporting). Up there with depressurizing the aircraft when you meant to turn off the Recirc fan. Or vaping in the cockpit. Or allowing vaping in the cockpit. Or not turning the packs back on immediately when your FO has incorrectly turned them off.

Sometimes you just have a bad day. And then there are some people who need to switch career paths, because they aren't cut out for the one they're in. We all have our own opinions about what the case is here...