For a substantial part of the game, Kain is your enemy. You only fight him once, though, and even then he is an unbeatable enemy.
And just why is Kain fighting against you?
He is being controlled by Golbez, who in turn is being controlled by Zemus - the big bad of FFIV. When Kain and Cecil go to Mist and unwittingly unleash the Bomb on the town, a little girl survives. This little girl is Rydia and she summons Titan to protect herself from the two scary soldiers who just destroyed everything her life. Titan causes an earthquake, knocking out both Cecil and Rydia. When Cecil awakens, Kain is nowhere to be seen. Knowing that he needs to get away from the area, Cecil takes a still unconscious Rydia and leaves, hoping that Kain is alive and okay.
Kain is indeed alive, although we don't see him again for a while. At some point, Golbez - the new Captain of the Red Wings - must have picked up Kain. Perhaps he was checking Mist to make sure Cecil had carried out his task properly, or perhaps he had been sent by the King to kill him. Either way, it's during this time that Golbez takes control of Kain. Golbez is very powerful, and turns Kain's inner feelings of jealously and resentment into hatred. Kain won't be holding back his emotions anymore, and this side of Kain is rather different to how he usually is.
The Kain being controlled says and does things that the real Kain would be ashamed to admit. He is very cruel, even more sarcastic, and he wants to make people suffer. The consequences of what he is doing just don't seem to matter. And while Golbez may be controlling Kain to a certain extent, he certainly isn't putting all those words into his mouth. Kain's brainwashing loosened his tongue and caused him to say things better left unsaid.
After the events at Mist, Kain is next seen in Fabul. The castle is under siege from Baron, and Cecil and his friends have been pushed back into the Crystal room. Kain appears, cold and callous. Cecil's joy at seeing his friend alive quickly disappears when he realises that Kain wants to fight him. It is only Rosa's cry that makes Kain hesitate; just for a second allowing the real Kain to take control. It is then that Golbez takes Rosa captive, immediately seeing how he could use her as a pawn against both Cecil and Kain.
Over the next few encounters with Kain, it becomes glaringly obvious how bitter and jealous he is over Cecil's relationship with Rosa. He becomes twisted, and spouts various insulting lines about both of them, which differ depending on which version of the game you play. Being held captive by Kain when he was like this must have been a harrowing experience for Rosa. Kain was, after all, a childhood friend, someone she grew up with and trusted. But despite what he does, both she and Cecil forgive him, long before he forgives himself, if he ever does.
Kain's loyalty switches more than once during the course of the game, although it could be argued that he is under the control of Golbez from the events at Mist right up until the player meets him in the Tower of Babel. Kain does rejoin you for a time, but could possibly still be serving Golbez and just using Cecil to do such helpful things as unsealing the Sealed Cavern and getting the Crystal. He didn't have a problem using Rosa to get Cecil to do what he wanted when we knew he was under the influence of Golbez. It could be argued, however, that a brainwashed Kain might not have been able to hold back from attacking Cecil even if it was against his orders. So who really knows? It's interesting to think about (at least, I think it is!).
Eventually, we end up with a remorseful Kain back with Cecil, and fighting to save the Blue Planet. Kain is tenacious - one of his strengths - and he sets out to better himself, and throw off the sins of the past like Cecil did when becoming a paladin. He wishes to regain his honour if he can, and to be someone worthy of Cecil and Rosa's trust.