yes. yes he did. draco and hermione live in a world colored by the politics of blood prejudice. the hatred of muggle-borns and muggles is pronounced throughout the death eater ranks, if not all of pureblooded society. this prejudice is dangerous and violent and it speaks volumes about the modern wizarding world. the first time the reader hears the word “mudblood”, it’s coming from draco’s mouth and it’s directed towards hermione. the word rolls off his tongue and you see the palpable and passionate hatred a twelve year-old child can harbor towards a classmate when he’s been raised and conditioned to think a certain way.
that harsh reality brought with it the beginnings of the very dark undertones the later HP novels would take on. there are prominent political undercurrents to the story, even as early on as CoS. look at the victims of the basilisk: moaning myrtle, colin creevey, penelope clearwater, justin finch-fletchey. all muggle-borns, all innocent of any wrongdoing, all attacked for their blood status. the malfoys are the bourgeoise, they hold power, land, and title unparalleled by any other family we’re introduced to. they are firm believers in the pureblooded mantra because they have family histories that describe the witch-burnings of the 1700s and the violence that followed. they also stand to benefit from a society that places purebloods at the top.
before hogwarts, it’s highly unlikely that draco was exposed to any muggles or muggle-borns. although lucius claims to harbor no ill-will towards them publicly, words spoken in private between friends and associates at dinner parties and gatherings trickle down to the children playing at their parents feet. a young boy who idolizes his father as much as draco did lucius would take anything he said at face value. when you’re seven and daddy just brought you your first real broomstick and he puts his arm around your shoulder when you finally manage to fly around the big apple tree in the gardens, you’ll believe him when he says that there are certaintypes of people that we don’t associate with - but keep this a secret, just between you and me, just remember not to get too close with their kind.
now when draco does go off to school, he’s immediately sorted into slytherin. there are no muggle-borns in his house from what we know canonically. he’s hanging out with the kids he’s known since childhood, whose parents are friends with his parents, who believe in the same pureblood mania he’s been taught. draco takes his classes, tries to suck up to the right people, makes sure he looks presentable every day before he leaves his dorm, does everything he can to make his parents proud.
he sees what his father told him about muggle-borns to be true: he is better than them at school, at quidditch, at everything. that is something he strongly believes. so when hermione granger walks up to the front row of desks in the first week of transfiguration and raises her hand like she’s read the whole textbook already, he’s annoyed. who does she think he is, she doesn’t even belong here. she beats him at nearly test in nearly every class, and his hatred intensifies because draco doesn’t think she deserves to be there and his father will be upset because malfoys are never second to anyone but he’s second to a mudblood.
on the other hand, you have hermione, a girl from an upper middle-class family in london, thrown into this world she knew nothing about. she also doesn’t like being second to anyone, and she knows she’s at a disadvantage when she learns that there are some kids who grow up with parents who do magic and brothers and sisters who already started school, so she buys all of her books and reads them, no, memorizes them, because who wants to look stupid in front of other kids? and hermione knows she’s not stupid, but she just wants to learn about everything because it’s so exciting and new. she’s secretly glad that she can fix harry potter’s glasses with magic before ever stepping foot in a hogwarts classroom - when he was sitting in a compartment with ron, a wizard from a magical family who couldn’t do a simple transfiguration spell.
hermione is just scared of not knowing everything and frightened of failure and she doesn’t want to be expelled because that would mean failure and losing magic forever and she can’t go back to that life because it was so utterly boring and now she’ll have missed a year of secondary school and how embarrassing. so she studies hard and does all of the extra credit and writes a minimum of three extra inches for every essay she’s asked to submit because she doesn’t have a magical family to go home to, she loves her parents but she loves her wand as well, and she’s not willing to give either of them up.
when draco malfoy calls her a mudblood, she’s shocked and hurt because she’s tried so hard to do everything she can to fit in with this world but there are still people who will tell her she’s not good enough and she never will be. and this eats away at her until there’s a gaping hole of insecurity and she signs up for more classes than what’s allowed and punches draco malfoy in the face. because hermione’s realizing she doesn’t need to prove herself to anyone but herself (which is why the punch scene is so important in terms of her character development fyi).
and then in fourth year people are dying, muggles are actually dying at the quidditch world cup and there are weak government attempts to stop things but everyone is just so scared, especially hermione. draco knows that something big is in the works - he doesn’t know what yet - but those filthy muggles will finally learn their place except he doesn’t really want them to get granger because he knows her and he still hates her but granger, they’re after muggles, do you want to be showing off your knickers in midair? because if you do, hang around..they’re coming this way.
fast forward to half blood prince, though, and that’s where the fun really starts. draco’s taken the mark, harry has a feeling about it, but it’s hermione who pushes him and says no, no way that’s impossible. hermione sees the good in people, almost always, and just because he was a childhood bully doesn’t mean he’s completely evil. harry’s becoming obsessed, he knows something is up, but she still says he’s being too hotheaded and no way.
this is also where you see draco become disillusioned with everything after his father is sent to azkaban, but he’s been marked and he’s been given this task to do and he knows he’s good enough but everything is just so scary because if he doesn’t do it then he and his mother will both die because of the scaly lunatic and it isn’t fun anymore. it’s not real, people are dying and for what? but he has no cards left to play and the dark lord has a full house. so he does what he has to do and he tries and he gets his aunt and the others into the castle but he just can’t kill someone that’s frightening i mean it’s albus bloody dumbledore for merlin’s sake - but he has to, he has to, he has to. and he doesn’t because snape gets in the way just in time - but he’s failed again and he’s starting to realize that his failures have more to do with him than with anyone else.
so when it’s been months and some snatchers show up at his house with harry, ron, and hermione, he’s the only one who could identify them and he knows they think the worst of him because why wouldn’t they? so for the first time in his life he does the right thing - but it’s not enough, not enough because now aunt bella has granger on the floor writhing in pain and she’s using a knife to carve something into her arm. and he thinks it might be a dark mark or maybe just lines or something ironic but no, no no it says mudblood loud and clear and the blood is red - so red, and not muddy. like his. and he realizes that it’s all so wrong. and when it’s the final battle, he just wants his mum and his dad and safety and that’s what’s important - family - not power or money or anything else, especially not blood status.
so, yeah, he called her a mudblood. the key is not letting that mistake define his entire character. this racial tension is actually one of the most important aspects of the draco/hermione relationship. to move forward, they need to accept the past and come to terms with it. i think that putting draco and hermione together would have been a great example of how two people who are so similar in every way except that one could actually learn to love each other.