It's one of those obscure rulings that the ball has bounced around a bit before he scores. Yes, he’s in an offside position but it's not an offside offence.
Of course the Assistant saw it but we have to accept that he knows the Laws better than any of us.