cat is an existing command with a specific meaning, different to that you require.
try something like the following instead
perl -ne '$entry{$1}=$2 if /^([^\s]+)\s([^\s]+)$/; END{for (sort keys %entry){print "$_ $entry{$_}\n";}}' tmp/2.txt tmp/1.txt
AA 123
CC 145
DD 567
FF 222
YY 128
ZZ 875
A few points to note, the records will be printed sorted on the first field.
The latest file should be provided last (the command will deal with more than 2 files)