Never attribute to malice that which is adequately explained by stupidity.

— Robert J. Hanlon in Hanlon’s razor

Some variations:

Never attribute to malice that which can be explained by ignorance.