How are basic decks built in Hearthstone?
I did some research of my own instead of waiting for another answer. I played 4 games with my Level 5 Mage (leveling her up to level 8 in the process). In none of the games did I manage to use the whole deck, but I wrote down all the cards that I drew throughout all 4 games.
First, to confirm Resorath's answer, none of the Level 2, 4, and 6 cards of the Mage ever showed up in the deck, but the original 5 cards that the Mage starts with all showed up in at least 3 games out of 4. So I can conclude that none of the later Mage cards are included into the basic deck as you level up.
Second, exactly ten other cards showed up in 2 to 4 games each out of 4, while no other cards ever showed up. So, only 15 different cards ever showed up for the Mage, some twice, making up the deck of 30. That means, it's not random, and the cards are set in for each basic deck. Most likely, they are tailored to each class. (For the curious, for Mage they are: Murloc Raider, Bloodfen Raptor, Novice Engineer, River Crocolisk, Raid Leader, Wolfrider, Oasis Snapjaw, Sen'jin Shieldmasta, Nightblade, and Boulderfist Ogre, plus the original 5 Mage cards)
Both of those conclusions could be very good coincidences, but, eyeballing the probabilities of these coincidences, I firmly believe that those conclusions are correct.
So, I did not experiment with all 9 classes, but I found my answer: The basic decks were pre-made by the creators of the game, and they do not change as you level up. I guess the results for the other 8 can be found the same way.
The basic deck attached to each character contains only free cards (neutral cards without gems) and the first 10 cards given to that class. These decks are always the same, and don't change when you receive additional basic class cards (while gaining levels) or open expert packs.
Their purpose is to provide a simple deck to start out with, or to play against someone who is just starting out.