Take the rap for (someone or something)

To receive punishment for something, to be accused and punished for something, to receive punishment in place of someone else.

The owner of the restaurant was forced to take the rap for permitting underage workers to work at night.