All the sins can be forgiven by Allah because that person may still believe in Allah but committed a crime against humanity. Whereas one who doesn’t believe in Allah’s oneness is a disbeliever.
إِنَّ ٱللَّهَ لَا يَغْفِرُ أَن يُشْرَكَ بِهِۦ وَيَغْفِرُ مَا دُونَ ذَٰلِكَ لِمَن يَشَآءُ
وَمَن يُشْرِكْ بِٱللَّهِ فَقَدِ ٱفْتَرَىٰٓ إِثْمًا عَظِيمًا
“Surely Allah does not forgive that anything should be associated with him, and forgives what is besides that to whomsoever He pleases, and whoever associates anything with Allah, he devises indeed a great sin.” (Quran 4:48)
So, we see here that Shirk is a sin of great magnitude. It is even the greatest sin! He has set this as an unforgivable sin. This is for those who are persisting knowingly in this act. Allah is the one who has established the laws and rules of creation, so he is the one who says which sins are greater than others.
Some may say is how can a thought like shirk be worse than an action like murder, theft, etc? We can see, just as an example, that sometimes even in our society that people are punished more for conspiracy to commit a crime than some who have actually done the crime.
Another aspect is that when one commits a crime against another person that person may forgive them or overlook them. Even in some cases we see the family of the one who was murdered forgive and hug the killer in the court room. However, when we come to the sin of shirk it is a continuous sin against Allah where the person is constantly rejecting the Oneness of Allah. He must stop the crime in order to get forgiveness.
Also, when we look at crimes, they vary in degree according to who the crime was against. It is natural for us to react to a man killing another man in the street as a horrible thing, but how much worse would we view it if that man killed his mother or grandmother who nurtured him and raised him with love and affection?! What about in the case of shirk? This is not even a crime committed against another human being, but it is against the nurturer and sustainer of mankind. Despite man committing this sin against Allah, He is still merciful by providing them with the faculties they need to be alive such as air to breathe and He also gives them sustenance whether they are believers in Him or not.
Imam Sadiq (as) has mentioned in a longer narration: “Do you not see the sun shines upon the believers and the nonbelievers, and the rain comes down upon the good and the bad?”
“When it rains, it pours upon both the houses of the faithful and the unfaithful. When the sun shines, its rays enter both the houses of the Prophet and the Abu-Jahl. The rivers pass through the cities of the believers and the disbelievers. God’s blessing are always like this. It is the nature of this world.” -The late Sayed Mohammad Shirazi
Shirk is the root of many sins and this corruption in beliefs is the chief of all wrong beliefs. Committing Shirk would lead one to gain no benefit from their actions.
وَالَّذِينَ كَفَرُوا أَعْمَالُهُمْ كَسَرَابٍ بِقِيعَةٍ يَحْسَبُهُ الظَّمْآنُ مَاءً حَتَّى إِذَا جَاءَهُ لَمْ يَجِدْهُ شَيْئًا وَوَجَدَ اللَّـهَ عِنْدَهُ فَوَفَّاهُ حِسَابَهُ وَاللَّـهُ سَرِيعُ الْحِسَابِ ﴿٣٩﴾
“The deeds of the unbelievers are like a mirage which a thirsty man thinks is water until he goes near and finds nothing. Instead, he finds God who gives him his due recompense. God’s reckoning is swift.” Quran 24:39