Adding egg yolks to a shortcrust pastry is completely optional. But the reasoning is because the fat of the egg yolk enriches the pastry making it easier to work with and rip apart less. It is also a wet ingredient so it helps to bind the dry ingredients together. I'd recommend making the shortcrust once without the egg yolks and once with and see which way you prefer.