Typically capacitors are used for electromagnetic interference (EMI) supression in DC motors.
As I don't have any detatiled information on the motor you use, my answer is based on the assumption that your motor has an EMI filter circuit that is similar/same to the one shown in the picture below.

Short answer:
Removing or destroying the capacitor will not impact the main function of the motor -> generating mechanical power.
As long as you don't have any requirements for EMI you can just operate your motor as intended even after destruction of the capacitor. This will do no harm to the motor.
Longer answer:
As you might also want some more detailed explanation, see below.
The commutation by the brush system generates unavoidable sparking. The sparking leads to a higher EMI output behaviour of the motor.
Depending on the project/application a high EMC behaviour might be unwanted.
You can reduce the EMI output by adding a filter circuit to the motor.
A simple but pretty effective EMI supression circuit is shown in the picture further above.
It is a typical filter circuit that is widely used; for example in almost all automotive applications that are driven by a brushed DC motor this circuit or a very similar circuit can be found. It is so popular due to low cost and pretty good EMI supression.
From work experience, I know that Cx capacitors in combination with a PWM controller can lead to some problems if the Cx value is not chosen properly.
A too high Cx value will put stress on the PWM controller MOSFETs and on the Cx capacitor itself. It can impair the switching behaviour of the controller and even lead to destruction of the capacitors and MOSFETs.
You mentioned your controller already has a capacitor included - most probably you mean the Cx capacitor of the controller.
Now if you connect your motor, the Cx of the controller and the Cx of the motor are connected in parallel. This means your total Cx value is the sum of both capacitor values.
I assume this value is simply too high for the motor+controller combination, leading to destruction of one of the capacitors.
If you don't have any EMI requirements my suggestion is to keep the capacitor on the controller side. It should already be optimized for the controller itself and the motor without internal Cx capacitor will not add that much of Cx capacitance to it.
Even if the Cx on the driver is removed, you can still operate your motor with the PWM controller - the controller might, however, have a little reduced lifetime without proper Cx configuration.