Did Tattaglia know Luca was a spy, or did he simply kill him because of the rivalry with the Corleone family?
It's not clear but it's likely that the reason was....
Just In Case
There's no indication that Tattaglia knew Brasi was gathering intelligence and Brasi had never sworn any kind of loyalty to Tattaglia or denied his underlying loyalty to the Don.
The first meeting was all above-board, Tattaglia offering him a job to work in the Family business as enforcer. The flirtation went on for nearly a month. Luca played his role of man infatuated with a young beautiful girl, Bruno Tattaglia the role of a businessman trying to recruit an able executive from a rival. At one such meeting, Luca pretended to be swayed, then said, “But one thing must be understood. I will never go against the Godfather. Don Corleone is a man I respect. I understand that he must put his sons before me in the Family business.”
The Godfather - Mario Puzo
However, Brasi's reputation for violence was considerable and Tattaglia couldn't take the chance that Brasi might take action against him because of Brasi's loyalty to the Don.
So, from a tactical point of view, it makes sense to remove the potential "threat" of Brasi from the field.