She DID have dittany in her bag. She used it to heal Ron. Why didn't she do the same for Dobby???
Ron's healing even with the dittany was slow. It also does not seem to help with blood loss, as per the comment about Ron's pallor. From Harry Potter and the Deathly Hallows:
"Harry and Hermione half carried, half dragged Ron through the entrance of the tent... Even this short journey had turned Ron whiter still, and once they had settled him on the mattress he closed his eyes again and did not speak for a while."
Dobby was more gravely injured, and likely suffering from internal bleeding and severe blood loss. Hermione was not an experienced healer. She lacked the skills to do much more advanced magical healing, and likely knew that this situation exceeded anything she was capable of fixing.
Also from Deathly Hallows, speaking about Ron but applies to Dobby as well-
" 'It's all I feel safe doing,' said Hermione shakily. 'There are spells that would put him completely right, but I daren't try in case I do them wrong and cause more damage.... He's lost so much blood already...."
Dittany appears to be good for helping to heal wounds, not fix internal injuries that require immediate surgery. Healing his skin would have been pointless given that he'd been stabbed in the torso and was likely suffering from a perforated heart/lungs/tomach/spleen/liver, etc. Any of which could be almost instantly fatal
Sourcing your own potion ingredients can save a Galleon or two, for starters. But some herbs could actually heal serious afflictions. Dittany can quickly cure nasty wounds, and mistletoe berries are essential to a well-brewed Antidote to Common Poisons. Very helpful!
"Greenish smoke billowed upward and when it has cleared, Harry saw that the bleeding had stopped. The Wound now looked several days old; new skin stretched over what had been open flesh."
Harry Potter and the Deathly Hallows
The question of whether or not dittany would have been effective is a good one to debate.
However, another thing to consider is the characters' state of mind at the time Dobby got injured. Hermione had just been tortured by Bellatrix, and all of them had just escaped imprisonment and certain death.
So, I doubt any of them were thinking very clearly or logically, especially Hermione.
Also, Dobby's injury was so severe that there was very little time in which to save him. He and Harry landed somewhat far from Ron and Hermione so Hermione wouldn't have immediately known that she could/should look for her dittany in time to save him.