The problem comes from the pipe flow direction. In the image of the original poster, the program is assuming that pipe flow is intended to be from the right to the left, with the angled pipe being downstream. Since it's downstream and flow is assumed to be from the right, it bends the angle like that.
The short answer: build your pipe network properly.
The long answer: Make sure connectors for equipment are consistent with their purpose (check the 'Getting into the Flow' white paper for support). Properly pipe from connectors to pipe mains of the correct system type. Avoid connecting one system type into another (ie Sanitary/Vent) without an accessory family that keeps the two systems distinctly separate. Avoid having active pipe systems with multiple open ends (cap the ends of mains if you're working on the branch lines). Avoid pipe loops unless you are setting up a primary/secondary bridge.
When you have a pipe system that is all correct connectors and one open end, Revit calculates flow direction properly. When you start to deviate from that by having multiple open ends or incorrect connectors, Revit has to assume. You don't want Revit to assume.