Both the read in the while line and the read in the loop body will read from the pipe, not from the terminal. The output from ls does not match the patterns, so the exit command will be called.
Parsing the output of ls is error-prone. You should better use something like
for files in *; do
read -p "Continue? (Y/N): " confirm && [[ $confirm == [yY] || $confirm == [yY][eE][sS] ]] || exit 1
#echo "tttt"
done
This would avoid the input redirection for the inner read.
If you don't need to exit from the whole shell script, I suggest break or return instead of exit.
More detailed explanation to answer a comment
In a simplified example
ls | while read -r files; do
read confirm
done
and assuming ls prints
foo
bar
baz
in the first iteration, read -r files will get foo, then read confirm will get bar,
in the second iteration, read -r files will get baz, then read confirm will get EOF,
in the third iteration, read -r files will get EOF and terminate the loop.