I need to find matches with the string in column 1 ($1) in file1.txt with the string in column 1 ($1) in file2.txt. Then I want to join the lines where there was a match in
If you don't mind the output being ordered by the first column then you can use this invocation of the join command:
join <(sort file1.txt) <(sort file2.txt) >out.txt