Bitter pesto is almost always a result of rancid oil. Make sure you are using quality olive oil that is fresh or within the use by date.