UPX is disabled on non-Windows due to known compatibility problems. From the source code of pyinstaller:
Disable UPX on non-Windows. Using UPX (3.96) on modern Linux shared libraries (for example, the python3.x.so shared library) seems to result in segmentation fault when they are dlopen'd. This happens in recent versions of Fedora and Ubuntu linux, as well as in Alpine containers. On macOS, UPX (3.96) fails with UnknownExecutableFormatException on most .dylibs (and interferes with code signature on other occasions). And even when it would succeed, compressed libraries cannot be (re)signed due to failed strict validation.