The default apt package on Ubuntu 22.04 is Spdyer 4.2.1, which seems incompatible with the embedded Python 3.10. The simplest way to install Spyder 5.4 on Ubuntu 22.04 is to install Spyder using pip and then make a symbolic link.
You may need to uninstall Spyder 4.2.1 first.
cd ~
sudo apt purge spyder -y
sudo apt autoremove
Step 1: Install spyder using pip
pip install spyder
Step 2: Create a symbolic link for spyder, replace your_username with your ubuntu user
sudo ln -s /home/your_username/.local/bin/spyder /usr/bin/spyder
Try to start Spyder on a terminal by
spyder
Spyder should now start correctly.