This is not a problem with Emacs, it is a problem with your shell's initialisation files or the shell itself.
M-x shell runs the shell in an environment where the
TERM variable is set to
dumb, which informs the shell and applications that the terminal does not support any terminal control escape sequences. Apparently something in your initialisation files expects to be able to clear the terminal, and the shell terminates if the terminal doesn't support being cleared.
If you really want a shell in Emacs with a full terminal emulator,
M-x term will do that. However, I would recommend that you fix your shell initialisation so that it works on dumb terminals.