The “unclean spirit” is Satan or his demons. Satan delights in causing uncleanness in persons, places and things. His going out of a man, as presented here, is voluntary, not like his eviction by force as when Christ cast out demons.
Matthew 12:38-45, Luke 11:24-26, Luke 11:29-36
Satan, Scribes, Unclean Spirits, Demand For A Sign, Satan And Demons