A plan to demolish a town centre building and replace it with a larger one for a cafe and a bed and breakfast has been permitted after a council initially rejected it.