>Does anyone else appreciate McCoy as being a foil to Spock?
McCoy, Spock and Kirk formed part of the trio in fiction. Star Trek is credited as the show that really popularized the concept of having 3 main characters who fight over what solution to pick and having one who decides. You can see a lot of similarity in other popular fiction like Harry Potter. (With Harry being the captain, Hermione being Spock and Ron being McCoy) or just "The Hero, the brain and the worldly one". This concept was popular in other forms of media like serialized novels and radio plays but Star Trek really solidified this concept and made it associated with it. Even now if you wanna propose a smart character in a story they usually get compared to Spock.
It's convenient from a script writing point of view because you can very easily invent conflict without it coming off as contrived. The downside is you must keep these characters consistent otherwise they seem less properly defined. It also allows people to grow more attached to specific ones since some people want to project themselves onto the brain or find the brain obnoxious and prefer the Captain or the Worldly one.
This was something TNG completely did away with in favor of having an ensemble cast since it was popular at the time to focus more on individual characters and have individual episodes for each cast member to fill out an entire season.