idk about her being a spy, but obviously she had something that the mist wanted, and my theory is that kakashi couldn't let it fall into their hands, so he had to do what a shinobi had to do
but let's think... when obito "died", kakashi´s ninja way point of view changed furthermore obito last will was that kakashi protected Rin with his life so, it would make nonsense if kakashi killed Rin because "he had to do it"