Ubuntu (and other Linuxes) has better package management, more UNIX tools by default and better tooling for certain types of development. For people who target Linux it's easier to build binaries for it.
It's also open and you're able to change it, tinker with it, mold it. You actually know where everything is. It's generally a lot cleaner as well: Apple litters the entire filesystem with stuff you don't know where it came from, or what they affect.
I believe faster boot times are also a factor, some people can get their Linuxes to boot nearly instantaneous. Perhaps battery life as well.
I use OS X and am happy with it because I don't demand any of that to be productive/enjoy my system, but I can certainly enumerate things I don't like about it and would rather have the "native" FreeBSD approach or a Linuxy one.
Some OS X tools try to make up the difference (homebrew, like you said it), but like any race where you start behind you're not gonna win. Especially since the other competitors have decades of experience.
OS X is basically a tradeoff. Some people aren't willing to trade away too much, or have personal choices which are more important to them than to you or me.
That said, I'd try to get Linux running natively on a Mac if I had that inclination, not under Parallels or some other emulator. That just feels the opposite of "clean" to me.