Join data in "file1" sorted by the second word of each line with data in "file2" sorted by the first word of each line, keeping the same order as it is found in "file1"
join -1 2 -2 1 <(sort +1 -2 file1) <(sort +0 -1 file2)