The EU was created to ensure peace within Europe. The economic aspects are secondary and merely enable that to happen by binding the economies together, so that you cannot start a war or leave the EU without significant harm to your own economy.
There is a European Defense Agency and there are EU battlegroups that sort of form a standing EU army. The EU definitely is a military union and there are quite a few people pushing for even more cooperation on that front.
EDIT: For those people down voting I would suggest reading the preamble of the Paris treaty[1], which essentially started the EU. It's not exactly subtle or ambiguous about the goal.
[1]: http://eur-lex.europa.eu/LexUriServ/LexUriServ.do?uri=CELEX:...