Sean Bean wasn't an unknown. He wasn't a star either, but he was the villain in one of better Bond movies and also was in the first Lord of the Rings.
Ned being killed off early is a key part of the "no one is safe in the game of thrones!" motif. Having a known actor and playing against type (nice guy when usually villain) just underscores the surprise.
There is a similar story about Gene Wilder in Charlie and the Chocolate Factory. He first appears with a limp and then somersaults to show he's fine. The whole point of that scene is to have the audience think "I can never trust anything this guy says again".
Normally you'd be right, except Sean Bean always dies.