It was the only move AFTER they elected to decline his 5th year option. They could have locked Sammy up for 2 more years or alternatively, picked up the option then deal him with some time remaining on his contract which would command a higher return.
EJ Gaines is no where near the player Sammy is and Jordan Matthews was never a replacement.