I certainly don't claim to have any special inside knowledge as to why Porsche engineers decided to route the exhaust that way, but I think that we can analyze the possibilities and trade-offs from an engineering view and perhaps see how one might come to such a conclusion.
The possible options
I think we can safely eliminate any front-facing exhaust configuration, so that leaves three choices one could imagine for routing the exhaust:
- out the sides,
- under the car or
- out the top
Each has its costs and benefits, but let's look at the considerations that may have led Porsche engineers to their conclusion. (Note that I'm lumping "straight out the back" as with the McLaren MP4-12C in with "under the car" in most of the following discussion, since most points would apply to either.)
Eliminating heat
First, it's both a high horsepower sportscar and a hybrid. The sportscar part means that the exhaust temperatures tend to the higher end of the spectrum and the hybrid part means that keeping the batteries cool enough is an important consideration. So getting the heat away from the batteries (and the other electrical systems) is an important goal. Any of the configurations might be employed successfully in routing heat away from the batteries, and away from the engine, but the entire length of the exhaust pipe will be very hot and radiate heat, so that dictates that the batteries almost have to be forward of the engine. In fact, the 918's batteries are between the driver's seat and the mid-mounted engine.
Weight savings
It is probably obvious that making a car lighter is a good way to both make it faster and to make it consume less fuel (both of which were design objectives for this vehicle.) Generally, weight should be eliminated where practical and even expensive things become "practical" for an $800K sportscar! Keeping the exhaust pipes shorter saves weight. This would likely be a point in favor of either top or side exhaust versus bottom exhaust.
Weight distribution
It's important to pay attention to where the weight is located in a high performance vehicle. Weight that can't be eliminated is generally preferred to be closer to the ground to lower the center of gravity of the entire vehicle to allow for better handling characteristics. Batteries, engine, electric motors and transmission are all heavy and are mounted as low as practical given other considerations. This makes bottom routed exhaust not impossible but perhaps more difficult to route than side or top exhaust.
Aerodynamics
The bottom of a racecar (and the 918) is smooth to allow for a continuous and unobstructed flow of air beneath it. Keeping the air flowing smoothly until it's already behind the car helps it go faster by reducing drag. The entire undertray of the 918 can be smooth all the way back to the diffuser at the rear of the car in part because there are no holes for exhaust ports.
If you follow Formula 1 racing, you may know about the "blown diffuser" used to great effect in the 2011 Red Bull RB7. The exhaust gasses were used as an aerodynamic element by having the exhaust flow over the rear diffuser. This was very effective until it was banned in 2011. So in theory, could the 918 have had the exhaust flow beneath the car through the diffuser and have an aerodynamic advantage? Maybe, but the real magic of the Red Bull car was that air flow and an engine mapping allowing the engine to continue to blow air over the diffuser even when the driver lifted off the throttle. Lacking that, as soon as the driver lifts, the aerodynamics of the car would have abruptly changed, which is not good. It may be that Porsche considered but rejected this because the system would have been more complex as a result and would not have been effective at other-than-racing speeds. Score another point in favor of either side or top exhaust. Having the exhaust above the engine does indeed mount it above the center of gravity for the vehicle, but the exhaust was also engineered to be as small and light as possible, mitigating the negative effect of mounting it high.
Awesome sound effects
Porsche takes some care in ensuring a visceral driving experience which includes the sound of the engine. Even Porsche models that are a bit more affordable include features such as the "Sound Symposer" which is a design feature with the sole purpose of transmitting the right engine sound to the driver's ears. Definite score for the exhaust out the top on this point.
Efficient top exhaust
Most of the points above favor either side or top exhaust. In fact, most V8 engines have exhaust headers on the side, so the natural shortest path for exhaust would be to the sides. However, the 918's engine has an unusual (unique?) feature compared to most V8 engines -- the exhaust headers originate within the V instead of outside it. That makes the "straight up" choice a clear winner in terms of shortest path.