The Playstation 4 and the Playstation 3 are two very different machines on the inside. When games are written for a console they are optimised to work with the hardware that the console has. When you change this hardware the code no longer works. This is why different versions of the game needed to be built for the PS3 and the Xbox 360. The hardware is different so it needs different code to work. If Sony were to make a PS4 that could directly play PS3 games, they would literally need to include a PS3 inside the PS4.
Consoles like the Nintento Wii are able to implement backwards compatability because the hardware is relatively similar. Use this an example, (fuel = game code) you can use petrol to fuel a Go-Kart or a Mustang. It works in both because they both have petrol engines, one is just more powerful than the other. If you go and put Deisel into a petrol engine it will not function (and ruin the engine). The Wii and Wii U can do it because they are both the same. The Wii U is just more powerful than the Wii and Gamecube, but they are still the same architecture (engine type). The PS4 cant play PS3 games because they are completely different machines that need different code (fuel) to function.
Back when the Playstation 3 was released it was able to play PS2 games because it pretty much had a PS2 built into it. This caused increases in cost and as we all know was eventualy removed. Some argue that it was just because Sony wanted to make more money by selling HD remakes. This area is a little gray, but the differences in the hardware is a fact and is a reason why we dont have backwards compatability on the system.