Spike has never liked Xander. He thinks he's a wanker, to be honest, and they've tried to kill each other more than once. But Buffy asked him to stay at the hospital while the others are too busy; to make sure Caleb doesn't try to finish the job. And for her, he'll do it, if only because losing Xander now would kill her.
But as he looks down at the bandages covering what's left of the boy's eye, Spike has to admit he didn't deserve what he got. Not that anybody would, of course, but like him or not, Xander's a good man, and a true-blue Scooby. And he's always fought the fight, though it should never have been his.
So when Xander starts thrashing about, obviously having a nightmare, Spike catches both his hands to stop him doing himself an injury.
And even when Xander calms down, he doesn't let go.