There are two primary effects. The first is the Lithography (imaging the poly lines in the resist).
If you project a single isolated poly line from the mask onto the resist on the wafer, it will have a width of say 0.9um.
Now if you project a nested (dense) set of poly lines (exactly the same width s as the isolated line, closely spaced together and look at the middle poly line, it will have a dimension of (say) 0.87um, This is due to diffraction.
So before we even start etch, there is a difference between a single poly line and dense poly lines close together. The single isolated line will always be wider. To avoid mis-match, you must avoid using isolated poly lines for critical gates. So this is the first reason for using two dummy poly lines either side of the gate. The gate is never isolated.
But the problem does not end there. Once the resist is patterned, the poly is then etched in a Reactive Ion Etch (RIE) system. Now you must think is 3 dimensions.
The RIE system works by creating a plasma which create active flourine reactants that will attack and etch away polysilicon. The plasma also create a polymer which deposits everywhere including the wafer surface. The polymer blocks etching. So the RIE bombards the wafer surface with ions which hit the wafer surface like an implant. This removes polymer from the surface allowing the fluorine radicals to attack and remove polysilicon. But as the poly is etch downward either side of the resist pattern, polymer deposits on the exposed vertical edges of polysilicon stopping any sideways etch underneath the resist pattern.
Now when all the poly is etched vertically (except beneath any resist pattern, the gate oxide is exposed beneath the poly. To make sure all the poly is removed over the entire wafer surface the etch continues after the gate oxide is exposed. The etch of the oxide releases oxygen locally to the polymer protecting the remaining poly beneath the resist pattern. However the oxygen will attack the polymer and remove it allowing the fluorine radicals to start etching sideways beneath the resist pattern.
This effect is competing the constant deposition of polymer. The net result is that after etch, the width of the poly will be slightly smaller than the resist image.
Now depending on how the RIE is set up, dense poly lines (where there is less poly locally to etch away, may clear faster than isolated. So the gate oxide is exposed sooner and the sidewall polymer is attacked for longer. Therefore dense lines may have even smaller widths than isolated. Or the RIE could be set up to do the opposite.
Anyway, the point is, isolated lines will be sized slightly differently the dense, so dummy poly is used to reduce this effect.