It was founded to make world war 3 impossible /through/ trade. By intertwining the economies of countries that considered each other hereditary enemies (Erbfeinde in German), it sought to make war too costly to consider. Humanitarian values are a core part of what became the EU.
That's one of the reasons the EU has had so many political problems with Hungary and Poland in the last decade: their drift to authoritarian forms of government (including weakening the judiciary in Poland) didn't impact trade at all. Nonetheless, it went against the humanitarian values.
I'm no EU fanboy (there's plenty to criticize), but regarding chat control and surveillance, it's important to see from which part of the EU institutions the push comes: the council. The council consists of the governments of the member states. It's not the big bad EU trying to force surveillance on the innocent countries; it's the governments trying to push domestically unpopular surveillance through the EU. The directly elected EU parliament has so far always prevented this push.
Given the current geopolitics, it doesn't look like the EU was very effective in eliminating the possibility of WWIII...