Whilst it does seem to have damaged him it was mostly a surface wound. Thor's body is turning with the spear so it ends up running almost parallel with him rather than straight into his body which minimises its effect.
When Hela then pulls on the spear and flings him away we get a clear look at his back where the spear should have come out and we don't see it so it didn't go through.
If you watch the scene below, starting at 1:10, you see the spear falls out/off of him when he's flying through the air and then completely when he bounces off the Rainbow Bridge.
Later we get a close up of Thor as Surtur brings about Ragnarok, the area of his armour on his chest where the spear went in his clearly damaged.
It's also worth noting that Thor has an incredibly high regenerative healing factor; much more so than other Asgardians. What little damage the spear actually did to him probably didn't bother him for too long.