Why are piston engines so unreliable in airliners?
This statement is not entirely true. the R2800 engine was considered at the time to be quite reliable in comparison to the R3350 and the R4360. Those engines represented the evolutionary dead-end of big piston power, where pushing to more power began making the engines less reliable than their lower-power predecessors had been. 

Part of this was simple statistics, where the probability of failure of a machine scales with the number of parts it contains. In crude terms this means doubling the number of pistons doubles the opportunity for something to go wrong with one of them in the engine. Note also that those extra pistons do not provide redundancy, in the sense that a failed piston will fill the oil system with broken metal, causing the other pistons to fail not long after, or start the engine on fire. 

Turbine power plants provide more uptime and longer TBO's than the piston engines they replaced as well as more power for less engine weight. These attributes offset the greater replacement costs and higher fuel consumption in applications where uptime and power were required to enable a viable business model. 

Cost-sensitive, low power applications still make use of pistons, with the breakpoint being around ~300HP. This is at least partly due to the fact that as turbines are scaled down in power output, their efficiency usually suffers, and their manufacturing costs do not fall fast enough to compete with pistons in the 250HP arena.