This task is about the technical inefficiency of storing it twice in the databases. For the problem of users seeing doc pages as being templates, see T54448: Transclusion dialog should not suggest documentation sub pages as templates.
Consider the following links:
As you can see, the same template data is being stored for both the "Template:Foo/doc" page (or Template:Foo/dados, on ptwiki) and the template itself.
Using <includeonly><templatedata>...JSON...</templatedata></includeonly> on "/doc" and "/dados" would solve both the inefficiency and the user problem (T54448), however doing so means the table can no longer be previewed when editing the documentation sub page.
A better approach would be to have a specific namespace, say "JSON:" (take this just as an example) such that "JSON:XYZ" would hold the JSON for "Template:XYZ" (and no other template). So it could be transcluded to "/doc" subpages if the users want that table in the middle of the documentation (which is not always desirable, since it seems a little technical for newbie users, repetitive - because of the template name, its label and its description - and will be too big for templates with a lot of parameters and aliases)
- T56140: Move TemplateData to its own JSON-content namespace and associate with Template-namespace, or to its own TemplateData content model and revision slot
- T54448: Transclusion dialog should not suggest documentation sub pages as templates
- T58516: Add TemplateData means to appropiate namespaces for using a template (Don't suggest "meta" templates on articles)