The modification is very simple. Assuming you have a file with one hostname per line, all you need is:
#!/bin/bash
username=someUser
script="pwd; ls"
while read -r hostname; do
ssh -n -l "$username" "$hostname" "$script"
done < "$1"
Then, run your script with the file as an argument:
script.sh /path/to/hosts/file
Note that I changed your variables to lower case. It is generally a bad idea to use CAPS for shell variables since by convention, global environment variables are capitalized and this can result in unexpected behavior because of name collision. This is double important when you're using standard variable names like HOSTNAME and USERNAME which are very often defined in the environment already.
Also, the -n option is needed here to stop ssh from trying to read the rest of the file. Without the -n, only the first iteration would work because the ssh command would consume the rest of its standard input and so end up reading the entire file.
HOSTNAMEvariable which you are overwriting in your loop and the globalUSERNAMEvariable (used by some systems). I doubt it is causing you issues here, but avoiding CAPS for variable names is a good habit to get into.