The mystery solved (and explained..maybe it will be useful to someone):
the
$.ui.dialog.overlayInstances global variable keeps tracks of every overlay created (maybe from multiple modal dialogs). This variable is initializated during the inclusion of the
jqueryui.js file and its initial value is 0.
It's a global, so you can access it from everywhere.
An opened modal dialog creates an overlay and increments that variable; when you close (or destroy) that dialog the variable will be decremented.
What happens if the dialog is inside an
UpdatePanel?
In my test the dialog was built closed (
autoOpen=false). Inside the dialog there's a postback button: it generate a partial reload of the page and only the
UpdatePanel will be rendered again.
Some event somewhere calls the
.dialog("open") and the dialog appears (overlayInstances = 1). Now if we click that postback button, the dialog will be flushed away (not destroyed nor closed!) and the
UpdatePanel will be rendered with a
new copy of the dialog.
The dialog (again) starts closed but now it will be opened: the
.dialog("open") is called and overlayInstances++ will be executed.
The
$.ui.dialog.overlayInstances isn't reinitialized, and now its value is (wrongly)
2!.
One final note:
I created another test case: the same page in HTML / javascript, with a postback emulation.
I saw that everything was running clear....until I noticed that I was replacing the UpdatePanel content with a
$("#updatePanel").html(remoteData);The
.html() funtion is SAFE!! It destroys the inner elements and detach their events.

Using a
document.getElementById("updatePanel").innerHTML = remoteData; I saw the overlayInstances problem again.