Again this hadith is not necessarily about hypocrisy at least it is not to be understood as you have -wrongly- concluded.
Imam al-Bukhari quoted in his sahih another -long- hadith that needs to be taken into account before deriving wrong conclusions from this one:
... Many members of our family gathered in the house and one of them said, "Where is Malik bin Al-Dukhaishin or Ibn Al-Dukhshun?" One of them replied, "He is a hypocrite and does not love Allah and His Apostle." Hearing that, Allah's Messenger (ﷺ) said, "Do not say so. Haven't you seen that he said, 'None has the right to be worshipped but Allah' for Allah's sake only?" He said, "Allah and His Apostle know better. We have seen him helping and advising hypocrites." Allah's Messenger (ﷺ) said, "Allah has forbidden the (Hell) fire for those who say, 'None has the right to be worshipped but Allah' for Allah's sake only." (Sahih al-Bukhari)
In this hadith -I only displayed the part that is similar to your quote- many sahaba came and asked the prophet about things related to the prayer and praying in the mosque and the prophet () gave them answers.
Note that some of the Muslims missed a man called Malik ibn al-Dukhaishin or ibn al-Dukhshun, which means either this person was not used to come to pray regularly in the mosque or prayed elsewhere or simply was ill or absent for a valid reason. The hadith -in full length- in fact shows that there were more than one mosque at the time in Medina. For possibly the first option some of them called Malik ibn al-Dukahaishin or ibn al-Dukhshun a hypocrite, which is a strong accusation. Especially if we accept the narration of ibn Ishaaq that says that this Malik was among those who were sent to burne the mosquen of dirar (of causing harm) mentioned in (9:107). So the prophet () reminded him about what this man used to say and also told him that Allah would never keep a person in hell that says so! Which means that Allah wouldn't keep a person who believes in hell forever. So this was an advise in first place. All the above is a short summary of what ibn Hajar al-'Asqalani has said about this part of the hadith in his fath al-Bary.
Here we have an accusation which might be correct or might not be we know that a wrong accusation is punishable!
This hadith has been covered in Sahih al-Bukhari third time here and in Sahih Muslim 1 & 2.
So far this only addresses the interpretation of the hadith.
You should know that Allah only knows what is inside us, and in this life we may be judged only by what we have done, not by what we have intended or what is inside us, this part of judgment is reserved for the hereafter.
You should also know that Allah accepts a deed if it is made with a good and sincere intention for HIM sake or in remembrance of HIM.
Hypocrites are in first place those who do deeds to show of that they are Muslims while they disbelieve or practice Islam by acts and don't believe by their hearts.