I tried the code on a unix box and it works like it should:
$ cat tstfile
if [[ $STR == "Hello World!" ]]; then
Only thing I can come up with is the use of the ! in your string. ! is kinda special and escaping it (\!) will probably not work.
Using single quotes should help. I.e:
if [[ $STR == 'Hello World!' ]]; then
Hope this helps.