There was always swearing in Brooklyn 99, they just starting more in depth with in Season 6 by using censor bleeps for comedic effect. As for why, it was due to the fact that Brooklyn 99 had switched from being FOX show to being an NBC show, following the single day cancellation of the show after the fifth season.