Here are a few things that demotivate developers:
When working as a team
- Always shouting at them in front of everyone, implies you have the least respect for them.
- Always assigning grunt work that has no meaning.
- No clarity over the current tasks.
- Unnecessary team meetings -- it kills productivity and creativity which results in less motivation to work.
- Not giving a break.
- Asking them to work for X hours every day and keeping track of the time.
- Not appreciating them when they do good work.
- Not motivating them when they are low.
- Always forcing them to be productive.
When working as a freelancer
- Not having a proper workspace to work.
- Always comparing yourself with others.
- Not seeing the positive side of any failure.
- Not using the right productivity tools.
- Not focusing on personal well being.
- Staying deprived of sleep always.
There's definitely more. I can only think of these right now. :)