It appears to me the laws of asheivat aveida (returning lost objects) would apply here. The money left in the charity boxes is like money found in your property. In this case it has a siman (distinguishing feature) in that you know to whom the money belongs (the organization marked on the charity box).
In a case like this, the one who finds the money must inform the organization that it should pick up its money (and he doesn't have an obligation to spend money/time to bring the money to the organization). In the meantime, the money should be safely kept aside until the organization comes to pick it up.
For fungible items (like money), one is permitted to use them if the owner doesn't come back for them, with the condition one will replace them when the owner comes. In your practical example, after a reasonable waiting period (a month?), the synagogue could use this money for its own needs as long as it has money set aside when the owner comes back to claim it.
It is possible however to change how the "default law" through public posting of a lost-and-found policy (or in this case a "Purim charity box policy". To quote R Yisroel Pinchos Bodner (Halachos of other people's money, ch. 185)
Any institution or individual catering to the public (e.g., yeshivos,
shuls, stores), has a right to make their own lost-and-found policy
governing what will be done with items left behind on their property.
The owner of a property can require that people who enter do so on the
condition that anything they leave behind may be disposed of according
to the way the owner says it will be disposed of.
In order for the policy to take effect the institution must display it
prominently for all to see (e.g., a notice on the bulletin board). For
example, the institution may introduce a policy stating that anything
left behind on their facilities will be placed in a lost-and-found
room (or cabinet), and disposed of after a specified time (e.g., the
end of every semester, etc.).
So it appears to me the behavior you describe is halachically permitted, although it would be wise for the synagogue to allow the charity organization to claim its money even beyond the time mentioned on the policy.