Joyce wasn't meant to be a storybook death, but one that was closer to real life experience (though Joyce had a much easier death than most of us will, Joss was downright merciful to the character), and by that I mean real life experiences for those left behind (who find the body and react to the loss). It wasn't just a story, it was art that transcends the story itself (*), IMO.
And it was used to build the story as Buffy finds herself overwhelmed, shutting down so that she goes to commune with the First Slayer who tells her "Death is your gift." Buffy reacts poorly to that because she's still reeling from the death of her mother. And Joyce did give some surprisingly warm speeches before her death scene.
(* Offhand, I don't recall any other deaths in the entire Whedonverse in that was art of this nature. Some were good to move the story forward in a number of ways and/or up the stakes and introduce genuine tension while others were just clunky and bad writing, IMO. Joyce's death is the only one I consider art rather than mere storytelling. I will say I thought Tara's death was way too forced and clunky, and I though I'm a bit more conflicted on Anya, I can see why that one comes off as way too dismissive of her character, and even ignoring her genuine character up until that point anyway.)