It depends entirely on what you're in the mood for, because they're different genres. Battlefront II is a large-scale shooter built around ground and space battles; Knights of the Old Republic is a story-driven role-playing game.
On overall quality, though, I'd point you to KotOR without hesitation. It remains one of BioWare's finest work, with a genuinely well-constructed narrative and a setting that uses the Old Republic era better than almost anything else in the franchise.
If you want a quick, chaotic session with friends, Battlefront II is the pick. If you want something to sink forty hours into, KotOR.