After I see some examples of shellcodes in various exploit examples they try to spawn a shell.
I want to understand why after spawn the shell have privileged access?
Doesn't the shell should have the same privileges as the user running the process?
Well, what to say except that you are fully right?
The spawn shell will have the exact same privileges as the process from which it is spawned, no more, but no less either. All the interest is here: the greater privileges the vulnerable application has, the greater privileges your spawned shell will have.
However, once you have a shell running on the machine, nothing prevents you from trying to run local privilege escalation exploits. But this will be done at a second step: