A burglar who targeted two homes only a few hours apart has since been serving a prison sentence for other offences, a court heard.