You were illegally crossing the border, maybe that doesn't warrant death but its still a crime. Also, was Tullius aware of this. He's off standing by the block while the Imperial Officer and Hadvar are questioning you. It seems more likely that the officer was just a horrible person and decided to cast a nameless prisoner's life away. One face shouldn't represent a mass.
I think the fact that the Imperials try to kill you in the beginning is a big influence as to why many players throw their lot in with the Stormcloaks (that and because most play Nords because its set in Skyrim). After playing previous games, I've always liked the Empire, and I think thats why I joined them, despite the fact that their not the same Empire I knew 200 years ago.
I don't think you were illegally passing into Skyrim, if you were, I'd like some in-game proof that it was illegal. Instead, you just got caught up in the Legion-Stormcloak crossfire.
And I don't understand your thinking. Yes, Tullius was standing around next to the chopping block, a mere 5/10m away from you. He wasn't talking to anyone, the only person he speaks to is Ulfric. All your asked is who you are. And then, the only conversation you hear is "Captain, what should we do? He/She's not on the list. Forget it, he/she goes to the block."