Most likely the olive oil used was past its prime or the parmesan cheese had been around too long. Be sure to use fresh spinach. I find baby spinach to be a bit sweeter than its larger leaf counterpart. If you feel the pesto is bitter, you can sweeten is with some honey, maple syrup or a splash of orange juice.