Wow, you've got quite a few questions all wrapped into one. I am assuming you are talking about a properly installed hot roof system.
Ants do not eat the foam but they will tunnel right through it if they detect food and water. When it comes to your roof this issue generally should not apply as long as the roof is installed and flashed properly.
Closed Cell foam in walls and floors also helps prevent them from coming in as it makes it harder for them to detect it.
Generally I recommend venting the bathroom fans directly out the gable end, though you can vent them through the roof. Read this blog post on my site for more.
Sewer stacks and other penetrations
If there is enough movement then yes it can pull away but that rarely is an issue as the entire space from the toilet up till it gets to the shingle stays at about the same temperature. The part exposed to the most temperature changes is above the roof and seeing it is shorter and not tied down the expansion / contraction will generally all happen up there.
Four pitch roof
The pitch doesn't matter except for how much room there is available to spray the foam in there properly.
For a new house that is wide open it isn't difficult to spray it. For retrofits this can be problematic trying to get the area blocked off and then sprayed correctly.
While you did not mention it, let me add in a few words of warning. Whether it is a retrofit or new, no one should be around while the spraying is going on. The areas need to be well ventilated before anyone goes in there.
The next thing is to make sure you spray in enough to eliminate the condensation potential.
For more information:
Read this blog post on Sean's website.