A man in New Zealand has been ordered to tear down his tiny house after a court ruled it had been built on a public road.