Let's get the "spoiler" out of the way right now: Darth Sidious and Senator Palpatine are the same person. While that's not technically revealed until Revenge of the Sith, Star Wars fans knew the two were the same because of the character's inclusion in Return of the Jedi—which, while the sixth chronologically, was theatrically released sixteen years before The Phantom Menace.
So while the film plays coy, it knows that you know it knows, you know?
So that's who Palpatine is. But, more important to our discussion here, what is the character's purpose in The Phantom Menace?
And the answer is that he's the antagonist, the character who is in direct conflict with our protagonist. It might seem as though Viceroy Gunray or Darth Maul would serve this role, as they come into contact with the heroes, but it is Palpatine who is pulling the strings. Neither Gunray nor Maul make any decisions… and are ultimately pieces in Palpatine's galaxy-sized chess game.
Palpatine is also an antagonist in the classic bad guy sense. He has no redeemable qualities and graduated from Villain U. with a Ph.D. in Maliciousness. At one point, he tells Viceroy Gunray, "Wipe [the Gungans] out. All of them." And you know you have a bad guy on your hands when the genocide of an entire species is an acceptable strategy.
But What's Puzzling You?
Confusion is the nature of Palpatine's game. This character keeps his cards close to the chest, so it can be difficult to discern what exactly he wants. Does he really want the treaty signed, or is he playing Gunray? Was his original goal to become Supreme Chancellor, or did he just see an opportunity and think, "Eh, why the heck not?"
Darth Maul mentions that he and his master "will have revenge" against the Jedi, but in this film it's not even clear Palpatine wants revenge. Revenge could just be an idea he feeds his apprentice to get him pumped up for a lightsaber duel.
Based on The Phantom Menace alone, we can't really say what Palpatine's motives and goals are except for one very important fact: he has power and he wants more power.
He wants the power to make his will law, the power to shape society in his image, and the power to kill those whom he considers an inconvenience. Unwilling to wait and see if he gets some power for his birthday, Palpatine's plan is to take it now.
The Devil Went Down to Naboo
We see this lust for power—and how this puts him in opposition to our heroes—whether the character goes by Palpatine or Sidious. As Palpatine, he displays these characteristics when counseling Padmé:
PALPATINE: If I may say so, Your Majesty, the chancellor has little real power. He is mired by baseless accusations of corruption. The bureaucrats are in charge now.
PADMÉ: What options have we?
PALPATINE: Our best choice would be to push for the election of a stronger supreme chancellor, one who could control the bureaucrats and give us justice. You could call for a vote of no confidence in Chancellor Valorum.
PADMÉ: He has been our strongest supporter.
He's just toying with the young queen, sowing the seeds of doubt that he'll reap later when Padmé calls for a vote of no confidence in Valorum. After he receives the nomination, he confidently proclaims, "I will be chancellor" and you just know he's won.
Palpatine effectively uses the crisis of Naboo to further his own ends and secures the most powerful seat in the Galactic Senate.
As Sidious, we see how he uses his power to further his own ends:
SIDIOUS: This turn of events is unfortunate. We must accelerate our plans. Begin landing your troops.
GUNRAY: My lord, is that legal?
SIDIOUS: I will make it legal.
GUNRAY: And the Jedi?
SIDIOUS: The chancellor should never have brought them into this. Kill them immediately.
This misuse of power puts him in conflict with our heroes… and not just because he wants them dead. Qui-Gon Jinn and Obi-Wan are both powerful characters, but they use that power to assist others, not for personal gain. Both help Queen Amidala and the people of Naboo despite having no personal interest until much later when Darth Maul makes an appearance.
As we see here, Sidious uses his power to twist the legal system to do what he dang well please. And as we saw above, he uses Queen Amidala and her cause to further his own agenda to achieve power.
While his ultimate goal may remain elusive until the sequels, Palpatine provides us enough clues to know that, whatever happens in the future, he'll be looking out for #1.