When bug#12865 was fixed, it was only applied when a new static ip address pool was created. The same validhostname command was also used when editing a static ip address pool but was not changed in that earlier bug fix.
Patch correcting this has been submitted to the dev mailing list and patchwork https://lists.ipfire.org/pipermail/development/2023-May/015983.html https://patchwork.ipfire.org/project/ipfire/patch/20230530111341.7511-1-adolf.belka@ipfire.org/
https://git.ipfire.org/?p=ipfire-2.x.git;a=commit;h=30dc340714b80f1bbf75e7449a9130a5bfad8f6a
https://blog.ipfire.org/post/ipfire-2-27-core-update-176-is-available-for-testing
Tested on vm system and confirmed that as well as creating new static IP pools with spaces in the name, existing pools can be edited with spaces. Fix verified.
Core Update 176 released https://blog.ipfire.org/post/ipfire-2-27-core-update-176-released