The European Union is essentially Europe's NAFTA, a free trade agreement between all member countries. It has developed a single market between all the members and adopted a unified form a money; the Euro.
Since the Union aims at promoting the free movement of goods, people, services and capital, nations directly connected each other would ideally have open or shared borders to make this process easier. If a union is promoting free trade and movement, the last thing you want is to have checkpoints and borders impeding that movement of goods, people, etc. When you are sharing borders, like America and their states, the movement that you are trying to promote becomes exponentially easier, and arguments or disagreements between member nations on the issue are less likely to occur.