During his private interrogation with Morpheus, Smith reveals to him that Zion is going to be destroyed, so there will be no need for him to be in the Matrix.
But why would he want to get inside Zion? He would probably be eliminated together with the fallen Zion. Even if he somehow got free, would he survive in the form of a program residing in Zion's mainframe?
He associated his longed-for freedom with the access codes. Besides, he obviously didn't want to let the other agents know his real thoughts, so he ordered them out of the room.
Smith to Morpheus in M1:
I can taste ... your stink. And every time I do, I fear that I have somehow been infected by it. It's repulsive. Isn't it?
I must get out of here. I must get free. And in this mind is the key. My key.
Once Zion is destroyed, there is no need for me to be here. Do you understand? I need the codes.
I have to get inside Zion... ...and you have to tell me how. You're going to tell me... ...or you're going to die.
Smith's underlying motive to get the codes is clearly different from the other agents' assigned purpose.