You're right, those aren't needed and some compilers will optimize them away anyway.
However - the reason people usually do this is to help spot out problems. For example, say you don't set the pointer to null. The object is destroyed, but then you incorrectly attempt to access the (what once was) pointer. Since the runtime will probably not clear it, you'll still see something valid there. This is only valuable from debugging, and it's still undefined behavior, but it sometimes pays off.