Well the basic error is clear: this parameter should not be set every time a new dotLRN instance is instantiated.
I may be accidently responsible for that, I accepted code for site-templates into 2.2.0 without studying it closely. After I took a close look (and thanks for the excellent comments, guys) it was immediately obvious that his is very, very wrong.
It would be fine to set this parameter in an "after_install", since dotlrn is installed by default by the install.xml file and therefore the param is set before the user has the chance to set their custom template.
But ... install.xml is setting the default template for "/" to dotlrn-master, only to have the after_instantiate callback overwrite it.
Wrong, and silly, even if moved to an after_install callback.
The proper thing to do is ot edit the install.xml file.
In this way, a new install gets set to the correct default, communities do not overwrite the site master template, and if the user wants to change the configuration they change it in install.xml, where the configuration info for which packages to install etc is also kept.
One-stop configuration, in other words.
I am testing and committing this change this evening, and it will be in 2.2.1 alpha.