No one knows how it turned evil =(

You'll have to wait for a sequel to find out, but in the meantime all that's known is that the spirits Masa and Mune were "put to sleep" for a time so they were unable to regulate the use of the sword and test potential new users. With them temporarily out of commission someone used the sword to kill the innocent. Then it was taken to El Nido. Boom, that's it.

Most people assume a bad guy used it for evil purposes. The sword amplifed this negative sentiment which deformed it into the jagged red sword we see in CC. Know one knows who took it (it's NOT Lynx, btw).