We really need a definitive SCOTUS ruling that searches of electronic devices violate the Constitution but if course we will never get that far. The intent of border searches originally was to identify goods being brought into the country to avoid paying duties or fees or being brought in illegally. Searching an electronic device is more akin to demanding to see what words are on a piece of paper you have in your pocket. Obviously the reason to search electronic devices is for political purposes like finding terrorists or illegal porn which is not what the Constitution is talking about.
Taxes, levies, excises, duties, substance schedules and a lot of other things are just implementations of political purposes/ideas.
Of course the difference between search for economic (tax evasion) control vs search for security (written/recorded "thought crime") control is the important difference here.