Inspectors warn of ‘appalling’ conditions and failures to take basic steps to reduce inmates’ potential risk to public