I think the thing about Martha is people forget her whole thing was designed to
1) Bridge Rose
2) Build a roving companion for the RTD Who Universe
Like, it would've felt wrong to just jump from Rose to somebody/something new given the intensity of that relationship, so you need to do something to bridge it. Moffat bridged Amy off-screen, but we still have in the canon months - years - of the Doctor moping in Victorian London with Vastra and crew looking after him. (It's funny to think how out of character this is, him staying in one place for ages, especially this year where the vault plot is built on how he doesn't want to do that, but the Amy grief is such that he does.)
So the mentions of Rose and the Doctor being unintentionally awful to Martha don't weaken or cheapen her, I think, because she grows around that and through that, and has a lot of agency throughout the series. It culminates, really, in The Sound of Drums where the Doctor tells Martha to do something and she just snaps back-- "I'll do what I like!!" which is something that, ultimately, most of the other companions would do. They'd either do it silently and face the music afterwards (Amy, Rose, Clara all have instances of this) or not at all. I think by the point she was ready to shout at the Doctor like that she'd already decided to leave the TARDIS, deep down.
But then she leaves, and the whole point is - again, people forget - she walks out of Doctor Who and straight into half of Torchwood series 2, and the thing about her there is that she becomes the Doctor-like character who is respected as an authority versus the rest of the cast. Then she's back in Doctor Who S4, and then she was meant to be in Sarah Jane Adventures but was replaced by the Brig because at that point Freema's career was taking off and she was getting offers from US TV shows. The interesting thing about the way she's been built, too, is she's absolutely primed to come back in a long time as a Kate Stewart style figure, as is Mickey - and that's cool stuff.
But anyway... the point is, the idea that Martha really got the short end of the stick I don't get. She's a well-developed character with a storyline that makes sense. The only two things that fall flat are due to RTD reaching too far - her family was too big so they just had to unceremoniously write the brother & his girlfriend/baby out, and then they spent all of her Series 4/Torchwood appearances building up her off-screen boyfriend before deciding for neatness it'd be better if she ended up with Mickey. Those two things are messy, but other than that she's brilliant. I'd put her above Clara - but truth be told we've not had a bad companion yet.