When you uninstall Exchange 2007 you need to remove all Mailbox- and Public Folder databases. If you try to remove the Public Folder Database this will fail because there are replicas of the system folders in the Public Folder database. I didn’t find a way to remove these replicas from the Exchange Management GUI but it can be done with the following Powershell Code:

Get-PublicFolder -Server <exchange server> “\” -Recurse -ResultSize:Unlimited | Remove-PublicFolder -Server <exchange server> -Recurse -ErrorAction:SilentlyContinue
Get-PublicFolder -Server <exchange server> “\Non_Ipm_Subtree” -Recurse -ResultSize:Unlimited | Remove-PublicFolder -Server <exchange server> -Recurse -ErrorAction:SilentlyContinue
Get-PublicFolder -Server <exchange server> “\Non_Ipm_Subtree” -Recurse -ResultSize:Unlimited | Remove-PublicFolder -Server <exchange server> -Recurse -ErrorAction:SilentlyContinue

(change <exchange server> to the name of your Exchange Server)