“Christ will judge the motivations of our hearts. Was it done for our glory or for His.”
The Pharisees thought they were doing all that criticizing and laying down of the Law for the glory of God too. They were very sure they were saved. They were positive they had the authority through their knowledge of Scripture to condemn others.
We know what Christ thought of them.
The pharisees didn’t have a concept of “saved”, and no, they were doing it for their own glory, that is one of the things Christ condemned them for.