No, it is not illegal to record Twitter spaces anymore. Twitter has recently added this feature to record lengths easily. It allows all the hosts to record their areas. You will find how to record Twitter spaces on their official help center.