There are at least 3 things that I can see:
\U modifier converts to upper case, whereas you have been asked to convert from upper to lower case
Your expression doesn't appear to remove spaces at all - this is probably easiest to do as a separate expression e.g.
s/ //g or (to replace horizontal whitespace more generally)
--in-place) doesn't make sense when you want to redirect or pipe the command's output to another file or process.
So putting all these together, you could use
sed -e 's/[[:blank:]]//g' -e 's/.*/\L&/' oldfile > newfile
If you want to modify
oldfile in place first, and then transfer the content to
newfile using redirection, you could do that at least in GNU sed using:
sed -i.bak -e 's/[[:blank:]]//g' -e 's/.*/\L&/' -e 'w /dev/stdout' oldfile | tee newfile
Note that you need to write to
/dev/stdout explicitly since the modified file is not written to standard output by default when the
-i option is used.
Alternatively (and more simply), move or copy the modified file:
sed -i.bak -e 's/[[:blank:]]//g' -e 's/.*/\L&/' oldfile && cp oldfile newfile