Simply doing excellent research is not enough. Progress can only happen when ideas are understood and adopted by other researchers. Peer-reviewed papers in reputed journals are the best way to get your work out to the scientific community.
The second important reason is that a published paper implies that the work has been endorsed by some of your peers, the people working in related research areas. As a result, peer-reviewed publications have become one of the important criteria to judge the quality of your work.
Before writing paper, it is worthwhile to know about plagiarism. It is important to be aware of how to give credit to others for their ideas, what items require to be cited and how to use and build on other researchers' work.