If You activated Two Factor Authentication, 2FA, on Your devices it could be that Your old Apple TV 2 or 3 after some time wants to be in the same "club".
Two weeks after I activated 2FA for my other devices, my ATV 2 demanded the code for 2FA?? I tried to log on to the ATV2 with my iCloud password but didn't succeed.
In the same article mentioned above, there is info for devices running older software.
"Then type your password followed by the six-digit verification code directly into the password field."
So, log on to Your iCloud account, on the ATV 2/3, use Your ordinary password but append the 6 digit verification code on the tail.
You can request a verification code when ever You want from a trusted device Get a verification code and sign in with two-factor authentication - Apple Support
After the successful log on You will have another request for Apple ID Sign In, but just skip it.