I like the other answers here, but I think they don't quite address Smith's full intentions. At the beginning, yes he is mostly likely just the head program in charge of killing the free radicals- humans of Zion inside the matrix. But since he is Neo's opposite (as described by the Oracle), as Neo learns more about being the One, so does Smith slip into insanity.
Oracle: Very soon he's going to have the power to destroy this world. But I believe he won't stop there, he can't. He won't stop until there's nothing left at all.
Neo: What is he?
Oracle: He is you, your opposite, your negative, the result of the equation trying to balance itself out
This is one reason he asks the other agents to leave, so they do not see the extent of his emotional degradation. He gets very personal with Morpheus (primarily with his bald head o.O) which is unbecoming of a program. I think he fears drawing too much attention to his loss of control as he may be targeted for deletion, possibly for acting too "human".
Finally, during the interrogation, he states that he wants OUT. Out of the matrix, away from the stench of the humans. He wants freedom. Perhaps he wants the Zion codes, not to give back to the Matrix mainframe, but to use it as a means to escape into the real world, much as he does after the first movie. However, by the time Smith gets into Bane's body, he realized the threat Neo presents to him and his potential freedom, so he seeks to destroy him before he can be totally free.