It was deliberately designed and written as such.
During the third quarter of the 19th century, an Estonian national identity was only just beginning to emerge. The region was conquered by Germanic peoples in the 13th century and then by the Russian Empire in the 18th century; for centuries it was dominated by an upper class which formed at most 5% of the total population and remained linguistically distinct from the rest. 19th-century German Estophiles formed the Learned Estonian Society in 1838, which ultimately helped to bring about the Estonian national awakening, of which the Kalevipoeg was an important part.
Thanks to the Lutheran church, the ordinary people of Estonia had higher literacy than those in other parts of the Russian Empire, which made this region particularly ripe for a national epic to take hold among the population. At this time, there was essentially no field of study for "Estonian literature"; the first bookshop for Estonian books was opened in 1867 in Tartu. This, again, was a contributing factor in making Estonia ripe for a national awakening aided by literature.
Inspiration could also be taken from the neighbouring country of Finland, where the Finnish Literature Society was founded in 1831 and Elias Lönnrot, one of the founders, published his version of The Kalevala in 1835, which ultimately became considered the national epic of Finland.
Georg Schultz-Bertram, a German Estophile, said the following in a speech of 1839 to the Learned Estonian Society:
Just think about how positively it would affect an oppressed people if they received knowledge of a historical existence and former strength. [. . .] Would they not feel like a beggar who is suddenly told: You are the son of a king! – What more can prove the historical significance of a people than the fact of having their own epic? [. . .] What is our [the Estophiles’] goal? [. . .] Do we believe in the future of the people or do we not? Is it more probable that they will eventually merge with one of their two mighty neighbours? But why then support a building which already bears in itself the germ of decay? No – I believe in the original strength of the people. [. . .] How, then, can our society foster the enlightenment and the spiritual rebirth of a nation that has been freed from serfdom and declared of age but that nevertheless suffers from its own sheepishness and despondency? I believe through two things. Let us give the people an epic and a history and everything is won!
Thus, the creation of an Estonian national epic became an explicit goal of the Learned Estonian Society in the next decades. Also in 1839, Friedrich Robert Faehlmann, one of the founders of the Learned Estonian Society, presented there his Ancient Tales (published later in 1846), adapted from traditional Estonian folk tales, in which he presented the character of Kalevipoeg (originally a malevolent giant in the folk tales) as a legendary king fighting for Estonian liberty. If he had had more time, Faehlmann might have written this national epic himself. But he died in 1850 of tuberculosis, aged only 51, and some of his contemporaries in the Learned Estonian Society (and even Lönnrot, who had visited them in 1844) believed that all hope of an Estonian national epic had died with Faehlmann and his knowledge of Kalevipoeg.
Friedrich Reinhold Kreutzwald, another member of the Learned Estonian Society, had written an unpublished German ballad in 1836 featuring the character of Kalevipoeg, in a version closer to that featured in the traditional folk tales than the more heroic character described in his later epic. After Faehlmann's death, the Society assigned to Kreutzwald the task of creating an Estonian national epic. He acquired a German translation of Lönnrot's Kalevala (he couldn't read Finnish fluently) in early 1853, and worked hard that same year to complete his first version of the Kalevipoeg in November 1853.
Kreutzwald believed that the stories of Kalevipoeg must have circulated among Estonian peasants for centuries. He put together fragments of oral tradition and set them into metrical verse, a form he believed was most appropriate for the creation of this national epic.
Publication of his completed work, however, ran into difficulty with the censor Carl Ferdinand Mickwitz, who apparently wished to please both tsarist Russia and the German barons. The Learned Estonian Society therefore published the Kalevipoeg as a bilingual edition, both Estonian and German, passing it off as a scholarly edition of ancient folklore for middle-class or upper-class intellectuals. But Kreutzwald was against the publication of a German translation, and the price of this bilingual edition made it unaffordable for most in Estonia. A more affordable monolingual edition was printed in Finland in 1862 and distributed in Estonia (particularly the south, as the north was more strongly Christian). But, like the first edition of the Kalevala, it sold few copies and slowly: the ordinary people of Estonia were simply not interested in consuming literature, aside from religious Christian texts. The earlier bilingual edition became unintentionally useful, however, as it started to be discussed in other parts of Europe, from Paris to Berlin to Helsinki to St. Petersburg (winning the Demidov Prize in 1860, and literary intellectuals of Europe began to recognise the emerging Estonian national identity thanks to the Kalevipoeg. In Estonia, meanwhile, young intellectuals began to discuss Kreutzwald's Kalevipoeg in literary circles from 1866, and Carl Robert Jakobson's Estonian schoolbooks included it from 1867. When the Estonian Students Society was founded in 1870 as the first ethnic Estonian student fraternity, they discussed the Kalevipoeg together starting from their first meeting.
TL;DR: the Kalevipoeg was written and published as part of a concerted effort since the late 1830s to promote the Estonian national identity. It explicitly aimed to be an Estonian national epic, and achieved recognition as such starting from the late 1860s and early 1870s.
- Cornelius Hasselblatt, Kalevipoeg Studies: The Creation and Reception of an Epic, Finnish Literature Society, Helsinki, 2016. This was my main source; its 148-page PDF is available online, and it's a very interesting read, with more detailed info on everything I've written here.
- Jüri Talvet, "Kalevipoeg, a Great European Epic", Estonian Literary Magazine 17(4) (2003), 9
- A few other sources (linked above) for minor details.