I didn't like it when TNG did it with Crusher and Troi for the same reason. Command isn't just a matter of rank.
Exactly. Doctors spent their training years learning medicine (or in Troi's case, pop psychology). Nobody should be put in command of a capital ship if their years of training had nothing to do with ships.
TNG was probably trying to address criticisms they'd received for not being feminist enough. They did a better job of that with Cmdr Shelby in "The Best of Both Worlds."