I finished using one of my two resources. Why did both of them go away when I called CancelAllocation?

Only use CancelAllocation to free up all the resources associated with the allocation. Use ModifyAllocation when you want to partially release resources.