You might need to step up your dental hygiene. Brush and floss regularly to avoid problems with your teeth and gums, like gingivitis, periodontitis, and tooth infections. Those conditions can all put a bad taste in your mouth.
If poor oral health is the cause, you could also have swollen, bright, or dark red gums or gums that bleed easily. You might also have bad breath.
If you have these symptoms, see your dentist for a professional cleaning and ask if you need a prescription to treat any infections.