In the 19th and into the 20th century, several interrelated social, political, and psychological transformations were taking place. As one-by-one countries began steering their ways toward more democratic governments, nationalism -- as a result, it seems -- became extremely popular. It was contagious among homogeneous groups and politicians and leaders took advantage of that. People were identifying themselves as citizens of countries, as members of communities with geographical borders that were something to be proud of. This pride and important sense of duty that came with it gave leaders leverage for recruiting soldiers and support for campaigns. In it's principle and practice, democracy lead to this kind of emotional relationship between individual and state because individuals can suddenly make the decisions for the state: the democratic state is supposed to be a state for the people by the people. It was favorable for people to identify with their country when they felt like they had a hand in it.
While democracy was fostering nationalism (or vice versa?), it was enfranchising more and more classes. The equalizing effect of this threatened the bourgeoisie's enjoyment of the political power their money and social power had afforded. Though residentially they began marking themselves off from the rest, the petite insisted on identifying themselves with them. The luxury of leisure amongst the bourgeoisie, which they could enjoy while not having to work thanks to inheritance and interest) became an identifying characteristic that popularized it for the petite and brought about the tradition of sports.
I find it really interesting that nationalism is so closely tied with democracy, but the relationship still isn't entirely clear. In some countries nationalism seemed to actually precede democratic rule. Why is that? The world had become more communicative by this point and more commoners were literate and could learn the sentiments of people in other nations, so perhaps getting a sense of others' pride in their countries, people elsewhere thought they should feel that same sort of pride, but couldn't if they had no part in their government, which then mobilized them to democratize.