Why are my weapons randomly lowering their stats?

Corruption-attack monsters

Certain enemies (especially the infamous Blobs of Corruption, as well as some bosses and other creatures - you can get more specific information here) have the ability to corrupt items you wear when they hit you.

Traps

Another way of corrupting items is through item corrupting traps (Corruption Fluid Trap), which look like this:

enter image description here

Dealing with corruption-based monsters and traps

The easiest way to decrease amount of corruptions your items get from mobs is to eliminate such corrupt-inducing creatures from distance, i.e. by using spells, crossbows, throwing weapons etc., or kill them before they will be able to retaliate (i.e. defeat them with a single blow or stun them repeatedly).

You might also want to remove/replace some of your key or most valuable equipment on sight of any corruption-inducing monsters or when the above trap is blocking an important path, then deal with the threat (kill monsters or try to disarm or step on the trap). After the danger of corruption is no more, you can put these items back on.

Ensure you have your trap detection skill high enough to see the problematic trap before stepping on it.

Anvil of Krong

You can also have your items being 'corrupted' (addition of bad enchantment) by Krong, when using an item on his Anvil. The chances of getting bad enchantment have been discussed in another Q&A here, which kind of points to the following wiki page.

Removing corruption from items

Last but not least, if you happen to have a Demonologist skill tree, you have access to its ultimate skill - Flames of the Heckforge. It seems to remove corruptions from an item, though it also weakens your character significantly (-4 to all primary stats) for considerable amount of time (99 turns). It also seems to be bugged and not always working in DoD versions prior to 1.0.9. Head here for more information.

Note the Demonologist skill tree is only available in the Realm of the Diggle Gods DLC package, available on Steam.