When ramchal was in Italy he was put in cherem for his writing and eventually left to live in Israel. Why did this happen and what changed about the perception of him?
The Ramchal was born 31 years after the death of Shabbtai Zvi, a false Messiah, who turned many Jews away from religion. As such the rabbanim in Italy, who misunderstood some of the Ramchal's writings for messianic, were very afraid of "another Shabbtai Zvi story" and threatened him with excommunication unless he stopped writing.
The Ramchal agreed to stop writing on kabbala and left Italy for Amsterdam in 1734 hoping the more liberal environment there would help him write more freely (that is where he wrote Mesilat Yesharim for instance). He finally made alyah during the last years of his life.
The second part of your question on the changing perception has been answered here in a wonderful way.