Closing a window in OS X Yosemite causes other windows to be made active
This is the Apple paradigm - all windows belonging to one app are part of a single process, unlike Windows, which is, as the name suggests, windows-based. Apple is App-based. What you are seeing is intended behaviour.

The simplest 'workaround' - though to me an indispensable way to use the machine - is to enable Spaces &amp; the associated hot-keys, then put 'important' apps on a Space of their own &amp; switch using the hot-keys. 

[I'm in the middle of teaching someone how to use that method right now in meatworld - a Windows migrant learning the new paradigm - so if you're interested, I'll try to flesh out exactly how to go about it.]