iTunes starts playing music automatically when watching Apple TV
Your remote is detected by both machines at the same time. They obviously do not know to whom the command is addressed, therefore this happens.

You have two choices:


Disable infrared remote reception on your Mac. On your Mac, go to 'System Preferences' and then 'Security &amp; Privacy'. Select the 'Advanced' button in the lower right corner. Check the box that says "Disable remote control infrared receiver" and click "OK'. Apple documentation.
Pair your remote with a particular device. To pair a remote with your Mac, follow instructions above and select the 'Pair' button to the right of the 'Disable remote' checkbox. To pair a remote with your Apple TV, go to 'Settings' > 'general' > 'remotes' from the AppleTV main menu, and then choose 'Pair Apple Remote'. You can pair 2 different remotes with each machine, but you won't be able to pair one remote with both machines. Apple documentation.