Rin was working for Oro, Oro wanted Sharingan & Senju Rin lured Kakashi and tried to steal his eye for Oro Kakashi had to kill her for that!Possible reasons.
1. Rin was a spy.
2. Kakashi was mistaken, e.g. the fog/mist around him could have caused accident.
3. Rin under genjutsuo
4. Rin was planning to kill someone else.