National Pride assisted in the carrying out of WW 1 - but it wasn't the causation. If you're looking for cause you need look no further than the dissolution of the Ottoman Empire. Czarist Russia and The Austro-Hungarian Empire really really wanted the bits that were falling off of the Ottoman Empire and they decided to duke it out over them and they brought their friends.
Nationalism, and racial pride is something recent - you'd never really have gotten anything like it in the 1700's - one's religion, one's local city or village was far more important. It's primarily because of the sacro-sanct nature of the nation state which is utilized for great national efforts (typically wars). Why does it continue despite it being illogical? Because it's a powerful tool for ruling people, and as such it's heavily pushed by any ruling power - just remember how bat shit crazy things were in 2001 after 9/11.