That's because you are reading your file1.txt twice and check whether they match. In the while loop you print 'CC' if the current line of file1.txt is also contained somewhere in file1.txt. Since they are the same files this is always true and 'CC' is printed after every line.

You might have been inspired by this question where the OP wanted to check whether words in file A are also contained in file B. Yours is a different case because you don't have two files.

Drop the first reading of file1.txt into %word_match and iterate over the file just once. Your line $word =~ /ing$/; only checks whether $word ends in ing but throws the result away. That code is similar to