Vulnerable care home residents were treated as an 'afterthought' and sacrificed to 'protect the NHS', the Covid-19 inquiry has found.