I don't think the New Girl and The Mindy Project showrunners are undermining their permanent talent, that's like accusing them of not being confident in their product. I think they're actually doing a lot right by hiring exciting guests; they're pleasant additions to something that's already good.
Guest stars are rarely female: And if they are, they are on very few episodes, sometimes not even consecutively. I imagine they do this in an effort to keep female focus on the leading lady of the shows. So basically, guests are chosen thoughtfully so as not to take any of the shine off of the genius acting and comedy of the real star.
Guest stars are very temporary: Guest star arcs, especially the very famous appearances, usually last one or two episodes (unless they serve a plot point and are important for story development, like Casey on Mindy or Elizabeth on New Girl (she has nothing to do with the Jess character anyway)). To me, this sends a message to the viewers that they get an exciting treat every once in a while, but not for long because, duh, the show belongs to the main cast! They're just keeping things interesting!
Guest stars are created and written to complement the main female and ensemble: Guest spots are carefully planned and written around the plot and permanent characters. The writing staff is not going to do anything to jeopardize the show's dynamic. In my opinion, the presence of an "outside" character brings freshness to the "situations" that is part of the genre of comedy. It also brings in a new angle for the core cast to play off of one another and sort of band together opposite this new presence and reiterate their chemistry. A guest character is just another plot point that lets the main ensemble get into their normal shenanigans, it just happens to be a new face rather than just an event.
Connections: Especially on Mindy, Mindy the real life human has lots of friends in very high places, so it makes sense for her to want to do her thing with them on the show that's named after her. It's like getting your best friends invited to your VIP party, only all of America is watching. Wouldn't you do that, too? I also imagine that celebrity publicists work very hard to get their clients in guest starring roles on popular shows that feature high profile talent, much like Friends did over its run. When the particular client is right, it seems like it would make sense for the people behind the shows to jump at the opportunity.
Finally, boring business and publicity reasons: I can't say this for sure because I'm just a lowly outsider, but people use celebrity presence to gain traction in an endeavor. Touting James Franco, Seth Meyers, Ellie Kemper, BJ Novak, Taylor Swift, etc etc etc on your show for an episode or two adds momentum to marketing and gains interest in tuning in and (hopefully) getting you hooked for good. Network television's business model and ratings system is floundering in this new age of cable TV success and internet binge-watching vehicles. They compete in time slots against a lot of TV noise, so any tactic they can use to get people to watch their show during their time slot should be employed. It might not be anti-feminist and undermining the permanent talent after all! It might just be about the money. Or at least partly about the money.
ALSO, let's not forget the New Girl beginnings which had Zooey Deschanel in the spotlight and the roommates as inconsequential supporters. This show was not nearly as good. Ensembles are great! It lets the viewer choose a favorite character instead of the show runners choosing for you. Change can be good!