Right, because someone pretending to be a Death Eater should say nice things to an upset muggle-born Gryffindor? He was a double agent. He had to do all kinds of upsetting unpleasant things that I'm sure he regretted.
This happened before the first event in the Tri-wizard tournament ... before Voldemort was back. He was not a double agent at that point.
Even if he was (which he isn't) - his double agent role and his 'teacher role' are not the same thing. A group of 14 year olds waiting to go into Potions are not looking to out him to the Dark Lord.
And - once he is a double agent - he is actually a triple agent. Voldemort believes he is spying on Dumbledore. So - in his context of pretending to be a death eater pretending to be a loyal teacher - yes he could have afforded to be slightly more professional with the Gryffindor students.
However he was no kind of agent at that point - he was literally just the potions teacher. He was being a dick because he was a dick - not for higher and noble reasons.
But most importantly - no he did not 'have to say anything nice'. He looks at the also cursed Goyle (maybe Crabbe) and just says 'go to the hospital wing.' No sympathy, no 'there there' - just sends him off to be treated. Which is perfectly acceptable, he is a potions teacher - not Goyle's mum.
But that is what he should have done to Hermione, as well. Instead he looked at her growing teeth and said 'I see no difference' - referencing that her normal teeth are overlarge (teacher making personal comments on a student's appearance - big no no), humiliating her in front of her classmates, and not performing his duty as a teacher to make sure an injured student gets adequate medical attention.
It is a deliberate choice to be cruel (in public!) for no other reason than his character is that of a vindictive bully.
The age difference would not be too big once Hermione was sufficiently grown up - but even in that last book - it doesn't matter that they're going to live to be 150 - 18 and 38 is too big an age gap.
And to just ram a marriage to Snape into the epilogue - after how badly he had treated them since way before he was a double agent - would have caused reader whiplash.
And it is never OK - in any world - for a teacher to marry their student. The power dynamic is too weighted in favour of the teacher (as would also be the problem with their age difference in Deathly Hallows.)
But mostly, it is the reason that Snape has been horrible to her and her friends - for no reason - for six years, which is why she shouldn't marry him. There's a big difference between recognising someone isn't evil through and through ... and marrying them.