Instead of attempting to replace a space, use a character class that would match any whitespace:
$ string=$'test\tstring 1'
$ echo "$string"
test string 1
$ echo "${string//[[:space:]]/}"
teststring1
[:space:]
denotes [ \t\r\n\v\f]
, i.e. it would match a space, tab character, carriage return, newline, and form feed.
As @glennjackman points out, you could remove the horizontal whitespace by using the character class [:blank:]
:
echo "${string//[[:blank:]]/}"
If you want to remove only spaces and tabs, say:
echo "${string//[ $'\t']/}"