Maybe Kyoko was helping to plan the breakout all along, but couldn’t get Ava out of her enclosure without outside help. Speculation: perhaps the enclosure requires more than just Nathan’s card to open, for example a password. So killing Nathan accomplishes nothing unless they also manipulate Caleb into hacking the doors.