How do you prevent pesto (basil) from becoming bitter?
immediate consumption

You make genoese pesto

(indeed the linked recipe is ok for genovese pesto and not simply a genoese  pesto-like green sauce)

for an almost immediate consumption. 

In such a case each of the ingredient can be responsible for a bitter taste or note. I would suggest checking each of them for their own taste. Some`hints are given by commenters.

Pine nuts can be sweet and well kept, or rancid (they have fats/oil). They can be perfect as those called "from Pisa" or less valuables. Check them and find the best from your local stores. 

Extra virgin oil can be of extremely bitter taste. Extra virgin mostly refers to the extraction, not to the organoleptic characteristics, of course. But this should be clear for you as you probably use oil for salad etc.

Pecorino sardo (romano as by official definition) can be more or less salty and quite pungent.  Traditionally, when it goes into pesto formulation, is very old and harder than parmigiano to give an idea. This can be overly tasty to many. In this case reduce its amount and increase correspondingly that of  parmigiano reggiano (or grana padano).

Now comes the core: basil. You cannot easily taste it alone but relies on parfum. It should not be minty or herbaceous at all. The best leafs are small and pale green. 

Here in Genova the basil is collected when the plants are about 12 - 13 cm tall.
Not sure about how many varieties of it can exist as obviously I stick to what is growing in my neighbourhood but for sure the tallness of the plants is s crucial point as for the biochemistry of the plant change after a certain level of maturity. Note that this has chemical basis. I.e. the essential oil composition change after a certain size.

However, rather than bitter a too big basil plant imparts a mint and/or herbaceous taste.

I suggest tasting the oil (if not done) as it seems to me the first suspect ingredient.

Related to oil: if you are using a blender (OP doesn't but let me stay general) be sure to work by very short pulses as for blending at high speed  can microscopically rise the temperature to "burns" ingredients. This is felt by some as a bitter/burned note indeed. 

Later serving

In case you make pesto for a later consumption: this is somehow detrimental as for oxidation is basically unavoidable. You will always see pesto getting darker and less scented to some extent. 

Unfortunately pesto is a delicious condiment only when is almost perfect. That is why long storage pesto items are disgusting as compare to other sauces in the supermarket shelves.

Nevertheless a home made pesto can be used within days if immediately frozen. Many families do that.  A nice trick is to use ice cubes racks so that the needed portions can be used at times. 

In this case is clever to skip the cheese while blending. Grated cheese is very prone to oxidation or perhaps microorganisms attack (not sure exactly) and gets pungent and bitter very quickly. 
So for postponed consumption better to prepare a cheese-free pesto and mix-in the cheeses just at the last moment, carefully working with a fork. 

Extra notes:


once I read here that somebody warm up pesto in a quick cooking fashion. NO and NO.
pesto "has an ingredient" that is never mentioned because does not enter the mortar (or mezzaluna or blender) step. Just before serving the pasta, a very little nut of butter and drops of cooking water shall be added to each portion in order to get a more pleasant creamy texture of the sauce. 


Buon appetito from Genova.