Most DNN modules contain only one module definition. So, in the "normal" case, all of the module controls (View, Edit, Settings, etc.) will return the same ModuleID. It is, however, also possible to create a module with multiple definitions with each definition having one or more module controls. The DNN Blog module is probably the best example of a module having multiple definitions. In such a case, only controls belonging to the same module definition will have the same ModuleID.
I suspect that when you created the module definition for your custom module - most likely manually using Host-->Module Definitions -->Create Module Definitions -- you added the view control to the first definition then added a second definition to which you added the edit control. You can check to see if this is the case by looking to see if the Definitions drop down for the module contains one or two entries. If so, you will need to move the edit control back into the first definition then delete the second.
It is also possible but less likely that you created multiple definitions in the .dnn manifest file. Again the blog module is a good example of how the manifest file is structured should you want to intentionally do this.