Many terminally ill patients who want to die at home are being needlessly admitted to hospital, a report has said.