kumagoro's answer is relatively good when it comes to mandated censorship, but there's another common case of voluntary "censorship" which is done voluntarily by production studios. For ecchi anime like the ones listed in the OP I think this is likely at least as common as any other reason for censorship.
The majority of television anime which get this treatment are late night shows. These late night shows operate in a very different way from traditional shows; they have to buy their own airtime from stations and rely on some combination of DVD sales and revenue sharing with the original source material. Because of the time slot and the fact that they are purchasing the airtime themselves, most of the broadcast guidelines simply don't apply. There is some more information on this at Why does anime usually air at night in Japan?. In any case, at the end of the day, most series need to sell DVDs to make a profit. The TV-aired version is essentially an expensive, high-quality advertisement for the DVDs and the source material.
The trend we've started to see with the rise of late-night anime is an increase in self-censorship. Most commonly, this is just airbrushing over shots with fanservice or with various other techniques. These are characteristic of the TV versions; such censorship is removed for the final DVD releases. Among the examples you listed, I'm quite sure that the DVDs of both Gokukoku no Brynhildr and Infinite Stratos have uncensored nudity. Trinity Seven possibly will as well, but I haven't seen any of the DVDs yet (the first just came out yesterday) so I can't confirm this. By censoring the TV release, this makes consumers more likely to spend the (rather large amount of) money required to purchase the full version. There's also been a rise in DVD bonus features and DVD-only episodes for similar reasons. So, to first approximation, the reason such censorship exists is because studios stand to make money from it.
Nowadays, the unusual cases are the ones where the TV broadcast is uncensored, like High School DxD. In most cases like this, only the broadcast on certain stations is uncensored or with reduced censorship. The most notable such station is probably AT-X, a premium channel which airs anime. They're known for having lower censorship, partly because of the premium status. In many cases, these shows air both on regular stations (in a fully censored form) and on a premium channel like AT-X in a partially- or fully-uncensored form. It's generally assumed that in such cases some agreement is made between such stations and the producers which is mutually beneficial, though the details of such agreements are private. Also note that even in the case of shows like High School DxD which aired on TV with essentially no censorship, there were modifications made to the final DVD product and short specials added to boost sales.
Interestingly, overseas simulcast companies like Crunchyroll also make agreements with producers to air their content outside Japan. Since DVD sales overseas aren't such a concern, the version they give to these streaming companies is sometimes less censored than the Japanese TV version. One recent case of this was Rail Wars!, for which the Crunchyroll version had far more uncensored underwear shots than the Japanese broadcast versions (but still no nudity, which was present in the DVD releases). This drew the ire of many Japanese commenters on various internet message boards.
I should state that this really only applies to TV anime, which is pretty much the only place you see this anyway. It doesn't apply to hentai series, which almost always release directly to DVD. Such shows are basically always uncensored, except insofar as they are required to be censored by the law. Likewise, OVAs and specials aren't typically censored in the way I described above, since those are finished products. If you see censorship in other places, it's probably for other reasons, but for the series you're talking about this is the explanation.