Works as designed.
If you start a script, the code itself is executed in a new shell. In this (new) shell the cd and ls commands are executed. When the script is done, the (new) shell is closed again and you end up where you started the script.
Hope this clears things up a bit.