She was a Nagato fanboy. She did whatever Nagato wanted to do. So Nagato went good, she turned good as well.