Essentially every country in the world asserts the right to carry out a thorough inspection of anything crossing its border.
I'm not sure why people think electronics would be an exception to this general rule (which has been in effect, like, forever... the only exception that comes to mind is diplomatic pouches).
> I'm not sure why people think electronics would be an exception
I'll take a swing at this.. one reason is that modern electronics contain - both directly and through remote access to other systems via stored cookies, etc - far more private and/or commercially-sensitive information than almost any other widespread physical object that may cross a border. In the 1960s a (non-spy) traveler faced a search of some clothing, cash-on-hand, and perhaps some food/snacks and prescription drugs. Far different from facing a search of every photo you've ever taken, every private message you've written to your spouse, or the full IP of your successful software company, etc.
I'm not sure why people think electronics would be an exception to this general rule (which has been in effect, like, forever... the only exception that comes to mind is diplomatic pouches).