If the idea or content has all the potential to be a patent then what is the importance of publishing it before the data is published as a research paper and why?
As far as I know, after the publication the possibility to register a patent for the published idea is usually lost, because the knowledge is regarded as public now. See also these discussions:
Publishing the research or publicly disclosing it before filing a patent application can severely limit its patentability and can completely bar the invention from receiving an Indian or foreign patent. Further, Patenting our research findings helps us to benefit commercially from the invention and have gratifying financial returns. Therefore, we as a researcher must delay our publications at least until a patent application is filed.
I think both are different. If research paper has been published on a topic, same content can not be published as a patent. Both have different relevanve.