I think that, while they both mean roughly the same thing there is a slight difference.
If you say "I didn't buy eggs because we already had some" you're saying you didn't buy eggs. "Did you buy eggs? I didn't buy them because we have some".
If you had gone and bought some eggs, then realised you already had some you would say "I needn't have bought eggs...". Meaning I bought eggs, but I shouldn't have because I didn't need to (because I already had some).
Or that's how it reads to me.