A council has been told to pay costs to a care provider after ‘unreasonably’ rejecting its plans to open a children’s home.