This question can be viewed from different angles
In my view, this matter needs to be understood from two basic aspects:
Determining the true status of the group
The first point is this: is the group that is being declared non-Muslim truly outside the Islamic beliefs, or is there a difference of opinion about it? In Islam, after tawhid comes the status of prophethood (risalah), and its importance is central. Accepting the Noble Prophet ﷺ as the Messenger of Allah and the last prophet is among the fundamental principles of Islam. There are solid and clear proofs for this in the Quran and the Sunnah, on which the Muslim Ummah has been in agreement for centuries.
After the passing of Muhammad ﷺ, whoever claimed prophethood was considered a liar, and the Islamic state confronted him severely. People who made such claims were even killed, and their followers were declared non-Muslims. On this matter all the sects of the Muslim Ummah, whether Shia, Sunni, Barelvi, Deobandi or Ahl al-Hadith, are in complete agreement.
The Qadiani issue
The Qadianis, who accept Mirza Ghulam Ahmad Qadiani as a prophet, claimed that the Messenger of Allah ﷺ is the Seal of the Prophets (Khatam al-Nabiyyin), but in their view Mirza Sahib is a “shadow prophet” (zill nabi). The scholars completely rejected this idea and started a movement against it. All schools of thought in Pakistan agreed that the Qadianis are disbelievers and that they should be declared non-Muslims.
The public movement and the reaction of the state
At the public level there was never any disagreement about the Qadianis being non-Muslim, but the Qadianis’ method was that at the outset they would not reveal their identity. They would express beliefs similar to those of Muslims, and when they had gained people’s trust, they would draw them towards Qadianism. Because of this method, the scholars and religious circles became concerned, and a movement began for a constitutional amendment to declare them non-Muslim at the state level.
Examples of other groups
In Pakistan there are several groups whose beliefs differ from the general Islamic beliefs, but since they keep themselves separate from the Muslims and live their lives quietly, no movement was ever launched to declare them non-Muslim. For example, the “Zikris” found in the areas of Balochistan, the Baha’is who came from Iran, the Bohri and Ismaili communities, and so on. All these groups live peacefully and do not harm the beliefs of the Muslims, so no movement was run against them.
Why did the need for a constitutional amendment against the Qadianis arise?
Unlike ordinary minorities, who engage in their own worship, the Qadianis would misguide Muslims by resorting to deception, hypocrisy and lies. This conduct of theirs had created disorder in society and a problem of law and order. Complaints of public clashes emerged in various places, after which constitutional action was taken against them at the state level.
Two paths to resolving the issue
Had the state not intervened, the public and the religious parties would have taken action against the Qadianis on their own. This would have increased social unrest and bloodshed.
The other option was for the state to resolve this issue through Parliament, where the Qadiani leadership would get ample opportunity to present its position. After debate in Parliament for many days, the constitutional amendment declaring the Qadianis non-Muslim was passed unanimously.
The Bhutto government and the constitutional amendment
Zulfikar Ali Bhutto initially thought that the Qadiani leadership should be allowed to present its position in Parliament against the maulvis, so that they themselves could convince the public. But when the Qadiani leader Mirza Nasir al-Din said that whoever does not accept Mirza Ghulam Ahmad as a prophet will be a disbeliever and his children illegitimate, Bhutto Sahib realised that the Qadianis were different from ordinary Muslims. After that, Parliament by consensus declared both the Qadianis and the Lahori group non-Muslim.
Ijtihad and the role of Parliament
According to Allama Iqbal, Parliament has the right of ijtihad, and it should be exercised in accordance with the opinion of the scholars. The same principle was adopted in the matter of the Qadianis, and the constitutional amendment was declared a logical and correct decision.
Concerns presented by the Qadianis
At that time the Qadianis and their supporters claimed that today we are being declared non-Muslim, and tomorrow the Shia, Barelvis and other sects will be declared disbelievers. But even after forty years have passed, no major religious or political party has demanded that Shia or Barelvi Muslims be declared disbelievers. Thus time has proved that these concerns were baseless.