Duchovny and Anderson just didn't get along...at least that's what they implied in recent interviews that they did while the X-Files relaunch was airing. There were traits that they found irritating in one another. They're older now though, and have become friends and can look back on those days and laugh.
I'm not privy to all the rumors that come out of the Castle camp, since I stopped watching the show regularly 2 seasons ago. But I know that it wasn't always like this between Nathan and Stana. They were once friends at least...and then something really did change sometime prior to season 7. The shippers noticed that their kissing and lovey dovey scenes decreased, and speculated accordingly.
I imagine that it can be difficult working together with someone for 14-18 hours a day sometimes, and maybe there was some truth to reports of Nathan acting like a diva. Then maybe Stana just went "I'm over this," and that's why there was that contract drama last year, on her part as well as his. And once someone puts a stipulation in his contract that he only wants to work with his co-lead, onscreen wife 2 days a week.....dang. Things must've been realllly icy at that point.