She very clearly says that she needs the spear before entering the Shadowfell. Therefore, you can't get it later, because she needs it NOW. She will threaten you if you try to go in without it and you have to actively choose the "I'll fight you if you complain" dialogue, if I recall correctly. You could've just gone back and.. gotten her the spear. Or don't, and face the consequences.
It would be bad writing if she stayed with you after. Sure, she likes you at that point, but she just got a direct order from her goddess. You know, the one she's been talking about all game. And while she already has her doubts thanks to you, she's not willing to give up on Shar just yet. 10 minutes, one area and a little bit of trust later and you'd have gotten her full devotion.
The Shadowfell progresses the story past act 2. You're basically entering to act 3. So what you did is the equivalent of walking into act 2 before finishing act 1, which won't end well either for some quests. Be my guest, try it out. Lae'zel won't be happy and the tieflings.. well they won't even be able to complain anymore.
"if I recall correctly. You could've just gone back and.. gotten her the spear. Or don't, and face the consequences."
Correct. Like I assumed it is not a bug, but bad design.
"It would be bad writing if she stayed with you after."
No. I think bad writing/design is not do the conflict in the most dramatic place, in the Nightsong lair. If the spear issue would come there in dialogue and the only way to get past in that point would without Shadowheart attacking would be a) have the spear b) successful persuasive check, (very hard one), that would be ok in my book. How they did in this case, was not good game design or good writing.
"The Shadowfell progresses the story past act 2."
True, but do not make my points less valid. They should have designed all companion quest in similiar quality like Lae´zels. (She had her own map/area for it.) I have never been against of idea of plot going foward, but the design decision of important companion quests, making them like they are just small sidequests. Wyll had rough time in his companion quest design also in Act 2.