Porsche now makes a flat 4 engine again- the new Boxster/Cayman engines are turbo 4.
On the cost issue, Porsche famously tried to cut costs for the 996/Boxster gen 1 by using a common cylinder head casting for both sides. This was done by flipping it over for the other side. The only problem with this was providing the drive for the camshaft from the rear of the engine. To do this, they created an intermediate shaft operating at the rear of the engine. This worked ok but it couldn't have an oil fed bearing, so they used a roller bearing. This caused a failure rate if something like 5% of engines, and caused a class action suit that Porsche had to settle.
The other advantage of boxer engines is their suitability for air cooling and packaging. In fact, Porsche produced an aircraft version of the flat 6 but it ended up being too exprensive to build and run, despite outperforming a lycoming by a long way.
On the cost issue, Porsche famously tried to cut costs for the 996/Boxster gen 1 by using a common cylinder head casting for both sides. This was done by flipping it over for the other side. The only problem with this was providing the drive for the camshaft from the rear of the engine. To do this, they created an intermediate shaft operating at the rear of the engine. This worked ok but it couldn't have an oil fed bearing, so they used a roller bearing. This caused a failure rate if something like 5% of engines, and caused a class action suit that Porsche had to settle.
The other advantage of boxer engines is their suitability for air cooling and packaging. In fact, Porsche produced an aircraft version of the flat 6 but it ended up being too exprensive to build and run, despite outperforming a lycoming by a long way.