What causes a tomato sauce to have a bitterness and getting rid of it?
A few things can cause tomato sauces to become bitter:


Overcooked spices.  Both basil and oregano can become bitter with long simmers.  Add them near the end of the process.
Under-ripe tomatos.  Store bought tomatoes are often picked green and ripened in the store.  These tomatoes make less sweet sauces (which may be contributing).
Cooking in an aluminium pan.  Aluminium reacts with the acid in the tomatoes and adds an off-putting flavour.
Seeds/skin in the sauce. Both seeds and skins can be bitter.


You can improve a bitter sauce by adding a small amount of baking soda (or salt), and something sweet (but not too much).