In the Middle Ages there were 3 major social classes, the Clergy, the Nobles, and the peasants. Now if the peasants were basically property of the lord and slaves, and their children were bound to the land, then how and where do the tradesmen, merchants, and doctors fall into on the social class totem. How many of them were there in comparison to the other classes? And how did they not get put into the peasantry class?
The main reason that tripartite division of medieval society doesn't accurately reflect medieval society is because it was never meant to. It's not modern historians' analysis of medieval society, which is much more complex and nuanced (as you point out, urban workers, craftsmen etc. are all excluded, as well as all the social stratification among all of the orders). The 3 orders are in fact a medieval concept, adopted by (lazy) modern historians as an easy way to explain medieval society to schoolkids and the general public. (As an aside, the word order is usually used for these groupings, rather than classes, which usually has a pretty technical, Marxist sense when used in history-writing). The division of society into three parts has a long history in medieval Europe, and was never really intended as an accurate description of society, but rather as a metaphorical/philosophical explanation of the inherent inequalities in medieval society.
The first appearance of something resembling the 'classic' tripartite description is by Ermold the Black, in a poem, written c. 828, to the Emperor Louis the Pious. Ermold describes Louis at the head of an ideal society consisting of the clergy (clerus), the people (the plebs or populus) and the aristocracy (in Ermold's Classicizing Latin, proceres or senatores). The prolific writer Heiric of Auxerre in the 870s brought this closer to the image we know, by redefining the 'people' as agricultores, farmers or peasants, and the nobility as warriors (belligerantes). The idea was influential, and c. 940 Odo of Cluny was writing of the ordo pugnatorum - the order of fighters/warriors - whose duty it was to protect the church and the unarmed people (vulgus inerme). Although Odo isn't specifically dividing society up into three groupings here, that understanding is implicit, and it's clear he's not doing it as a way to describe 10th-century society but as a way of moralising, particularly to violent secular aristocracy, about people's proper role in the world.
The early 11th century saw the classic definition of the three orders, by two writers in particular - Bishop Adalbero of Laon and an anonymous writer working for (and expounding the political views of) Bishop Gerald of Cambrai. They expounded the classic tripartite division of society into those who pray (oratores), those who fight (bellatores) and who work (laboratores). But they were, just like earlier writers, describing how society should be, rather than how it was: Adalbero asserted that as long as this model was followed by society, peace would follow. It was a harmonious and balanced model, designed to reassure a society which was in reality marred by deep divisions between the powerful and the powerless that each person played an important role in the world. As J.P. Devroey puts it:
"The tripartite division was therefore not functional [...] it was an end unto itself, a guarantee of the order of the world. [...] it was an essentially static and abstract concept, which had little to do with the manner in which social position was evaluated by contemporaries of Adalbero (or his Carolingian predecessors) or with the real situations which prevailed within the orders of clerics or of warriors."
The three orders thereby became representative of medieval society, not because they accurately described society, but because they were held to represent the natural order of things, the way in which each section of society was supposed to be in harmony with and support each other part. This was never the reality, and medieval people knew it - hence the need for the theory in the first place. The best illustration of the metaphorical, rather than literal, value of the theory is in John of Worcester's chronicle, when John has representatives of each of the orders visit King Henry I of England in a dream to complain about how his despoiling of churches has completely destroyed the natural order of society (this section was written after Henry's death, probably c. 1139). It was a nice, vivid and easily comprehensible way to represent disruption of the totality of society to the reader.
In short, the three orders were never meant to be taken seriously as a description of society. You'll also notice how in most incarnations, the third order are 'workers' or else generally 'not fighters', rather than being explicitly peasants, so they would in theory incorporate urban workers etc. The real problem is that historians (and 'historians') not specialising in the Middle Ages have adopted the image without fully understanding it and have used it to present a grossly simplified version of the medieval past to the public (sadly, a phenomenon that's all too common). The truth is in fact a lot more complicated (and interesting!).
I teach this to Junior History classes and I am always at pains to indicate that a simplified social pyramid more frequently than not, fails to adequately address the complexity of any social structure. Not just tradesmen, but Yeoman farmers, fishermen, men-at-arms, etc that don't fit within the normalised 3 classes structure. I use a modern comparison of modern society with its upper (rich), middle, and lower(poorer) classes to illustrate why it is impossible to codify a society in this manner. It can, however, be argued, that the 3 class structure does have some semblance of truth if applied to a small demesne/manor.
Examine the structure of a castle and associated town and try to fit this 3 class structure - best of luck. It does not apply.