Echo passes only the data which is separated by whitespaces
For example:
echo $(echo "a b")
Output : a b
For the above example only a and b will be passed
But if you enclose it with double quotes the whitespaces will be preserved
echo "$(echo "a b")"
Output : a b