That’s because deleted topics are marked as deleted not removed from the database. Wanting to reassociate an ID with another topic seems like a bad idea (but you didn’t ask). You can force the topic to actually be deleted (Introducing permanently delete post functionality might be how).