You must set the template to 'dokuwiki', not to 'default'; then place your sidebar page in the root namespace.
It seems that you can also put sidebar pages in namespaces where you want to have alternate sidebars for those namespaces; then when a page in such a namespace is accessed you will get the alternate sidebar for that namespace.
There appear to be two pages that comment on the sidebar:
https://www.dokuwiki.org/template:dokuwiki
https://www.dokuwiki.org/faq:sidebar