Faith is action, not just belief. Not only is it possible for someone to leave the folds of Islam through neglect, but also it happened during the time of the Prophet ﷺ during the battle of Tabūk.
وَلَئِن سَأَلْتَهُمْ لَيَقُولُنَّ إِنَّمَا كُنَّا نَخُوضُ وَنَلْعَبُ قُلْ أَبِاللَّهِ وَآيَاتِهِ وَرَسُولِهِ كُنتُمْ تَسْتَهْزِئُونَ لَا تَعْتَذِرُوا قَدْ كَفَرْتُم بَعْدَ إِيمَانِكُمْ إِن نَّعْفُ عَن طَائِفَةٍ مِّنكُمْ نُعَذِّبْ طَائِفَةً بِأَنَّهُمْ كَانُوا مُجْرِمِينَ
If you ask them (about this), they declare: "We were only talking idly and joking." Say: "Was it at Allah, and His Ayat (proofs, evidence, verses, lessons, signs, revelations, etc.) and His Messenger (SAW) that you were mocking?" Make no excuse; you have disbelieved after you had believed. If We pardon some of you, We will punish others amongst you because they were Mujrimun (disbelievers, polytheists, sinners, criminals, etc.).
— Surat At-Tawbah 9:65-66
In his Tafsir, At-Tabari mentioned the occasion over which the verses above were revealed. 'Abdullah ibn 'Umar narrated that during the battle of Tabūk, a man said: "We have not seen any people more desirous than our reciters [of the Qur'an] when it comes to their stomachs, lie as much, or are as cowardly when facing [the enemy]." Another man responded: "You lied, for you are a hypocrite. I will surely tell the Messanger of Allah." When the Prophet was informed, the verses above were revealed to him. 'Abdullah ibn 'Umar said he saw one of those hypocrites hanging to the Prophet's camel, being dragged on top of rocks, saying: "O' Messanger of Allah, we were only talking idly and joking." The Prophet ﷺ answered him with the above verse. Ibn Kathir mentioned the same story in his tafsir, and Ibn Is-hāq said that the one who was pardoned was Makhsiy ibn Humair (from Banu Ashja'). This story shows us that Allah decreed that group as disbelievers although they declared the shahadatayn, prayed, fasted, etc. They went out of the folds of Islam through an act of neglect through their tongues.
After the death of the Prophet, all the tribes of the Arabian peninsula — save for Mecca, Medina and Jawatha — apostatized. There were three common forms of apostasy:
- Some tribes refused to pay zakah.
- Some tribes reverted to idol worshipping.
- Some tribes declared themselves followers of false prophets, e.g., Musaylimah al-Hanafi, Al-Aswad al-'Ansi, Tulayha al-Asadi, and Sajah bint al-Harith.
Abu Bakr launched the wars of apostasy campaign against all three groups without differentiating between those who prayed and fasted but did not pay zakah, and those who falsely claimed prophethood.
The hypothesis of upholding only the first pillar of Islam and neglecting the other four pillars was put into practice numerous times over the course of history. There are many authentic hadiths (see Sunan Ibn Majah 36/124 and 37/4300, for instance) that bring good tidings to those who declare the shahadatayn. The Prophet ﷺ, however, taught us that good (or bad) intentions alone are not to be rewarded (or punished). For instance, each one has one's share of adultery through the eyes, the ears, the tongue, or the heart — but only what one puts into effect through a form of action that rises to the level of being punishable (see Sahih Muslim, Book 46, Hadith 33).
This is what prompted Al-Hasan al-Basri — when told about a group of people that claimed to have good intentions toward Allah, and that their faith (the shahadatayn) in their heart was enough — to say: "They lied, by Allah. If they had good intentions, good deeds would follow. Faith is what lies within the heart, and is put into effect through actions." Needless to say, when it comes to worldly matters, this concept is very clear. We rarely, if ever, see a student pass an exam simply by declaring they know the answers to all the questions ... within their heart or mind.
Finally, there are rules that govern what nullifies Islam. Saying the shahadatayn gets one into Islam, but does not necessarily keep one within the folds of Islam (e.g., someone who says the shahadatayn then curses Allah and his Messanger), but this is a different topic.