The relative path to file2 seems wrong; the output redirection is relative to the current directory, not the directory of the file you are grepping.
The relative pat you are grepping seems wrong too; /../ is equivalent to / is equivalent to /../../../../../
The backticks in the for loop are what are splitting up stuff on whitespace. Use a construct which is less sensitive to spacing issues, or use proper quoting.
Code:
for h in "`cat file1`"; do grep -rl "$h" pathtodir >>file2; done
or
Code:
while read h; do grep -rl "$h" pathtodir >>file2; done<file1