In short: yes it is legal, but you must follow some legal requirements.
Unfortunately the license (GPL 3) isn't the most ideal for a game engine, and is based on mostly immutable decisions from decades ago.
By distributing ZC's binaries yourself, you must follow the software license of ZC and the licenses of its various dependencies[1]. That can be accomplished by:
1. Including the license text of ZC and all its software dependencies [2]
2. Providing the source code used to create your game upon request (zscript, etc.) [3]
Note that while giving people your code is technically merely "upon request", it is typically fulfilled by publishing the code somewhere online, or simply distributing the code along with the game. You could just send the code to anyone who emails you, but if you don't show good faith (by not responding in a timely manner), you would be in violation of GPL. Since anyone who gets the code in this way is free to do anything with it (given they also follow GPL), they could also decide to publish it somewhere; so you might as well do that yourself.
It's also a requirement to provide the source code for ZC "upon request" - but that can be fulfilled by just linking to our GitHub. If you fork it for any reason, of course you'd have to make that code available somewhere in order to legally distribute its binaries.
Things excluded from GPL (and software licensing in general) are stuff like artwork, story, gameplay mechanics, etc. Software licenses are just about code, and only kick in when you distribute binaries. In other words, your game's implict (or explicit) trademarks or non-software copyrightable material are NOT relevant here.
Based on my understanding of things, the actual qst file also does not fall under GPL. For example, if you only distribute a qst file with directions to load it in ZC, you wouldn't have to follow any part of the GPL (as you would not be distributing any binaries). Of course, that's a bad idea for reasons unrelated to licensing.
Finally, I'm not a lawyer. Anyone planning to spend the time and resources needed to make a game should first validate all this with a lawyer. If anyone ever seeks counsel on this topic, it would be helpful to share what you learn with this community.
EDIT: one more thing, many assets currently distributed with ZC (like sfx, tileset graphics, etc) are not necessarily under a permissible license. It's highly recommended to not utilize any of these in a commercial game, for the time being.
-----
[2] ZC comes with a `licenses` folder, which has ZC's license and all its software dependencies' licenses. I just noticed that the package export feature of ZC is not including these in the output folder. I'll fix that soon.
[3] There is some ambiguity here about whether this includes just scripts that use the ZC standard library (std), or any script given that ZScript interfaces with ZC at runtime. The safest interpretation is that all scripts fall under the GPL when distributed alongside the ZC binaries. Additionally, scripts found on this website are licensed separately by their own authors, and you should seek permission before using them in a commercial game.