The project manager should be held accountable for the failure of a project.
If you are a program manager (manage project managers) you should hold your project managers accountable.
This sounds obvious, but often this accountability is only mentioned at the end of a failed project.
The program manager should require regular (weekly) reports on status and at least monthly financial and schedule reports (performance measurements).
It is more difficult to hold a project manager accountable if he/she was not involved in the project from the start (initiation / tendering), including scope planning, schedule, costs, objectives, etc.
If the project manager is not involved from the start, he/she may blame a failed project (over budget or over schedule) to a badly estimated / planned tender.
If the project manager is involved right from the start, with the proper support and authority given, it is reasonable to fire the project manager of a failed project (unless the PM can show causes outside of reasonable planning or control of a PM, such as natural disaster in an area not prone to them).
Some of the links on this website may be affiliate links to products I use, have tested or am familiar with. I may receive a commission if you click on some of those links and make a purchase. This is at no additional cost to you.
This must assume the project manager has had proper training, not just someone thrown into the role of PM without training.
It must also allow time for training a new project manager to your organization in the internal procedures, templates, systems, etc.
In initiating, if a project manager believes the project is being underfunded, the schedule is unrealistic, or the price is too low, they should say so, change it, and then sign the changed project plan. A project manager should not accept an unrealistic schedule (unless agreement is reached with management that the project will make a loss or similar (such as breaking into a new market).
Accountability could mean loss of status/title, moving to an assistant project management role, or possibly being fired.