I finally found the reason and the solution.
REASON:
Looking into the .ear archive I saw that the "native" ejb (ProjectEJB) was placed into the root of the archive and the "independent" ejb (ProjectWithProblematicMDB) was packed in the lib folder. For some reason because of this, glassfish was creating the pool in the .war module too.
SOLUTION:
Adding ProjectWithProblematicMDB to ProjectEAR as a dependecy made maven pack it in the root of the .ear archive too and wasn't in the lib folder anymore. After I deployed the application in this form, the second pool (the one from the .war) was not created anymore.