The answer is that `$(command)` expands to the raw output of the command, which your shell will then perform its usual word separation on. Said separation consists of _any_ whitespace being considered a word separator.
You are also doing two different things with the text; in one you are parsing it through `read` (which works on _line_ input and not _word_ input, and in the other, you are iterating over the output of `$(cat)` in a `for` loop. You could probably get similar results with `IFS='\
' for i in $(cat test.txt); do echo "$i"; done`.