Here's a simplified, idealistic example of what is usually happening in this situation:
Management has Team A that they think has a velocity of say 100 story points/iteration.
Management thinks Team A can deliver 100 pts of business value stories each iteration.
In reality Team A is is always pressured to provide more and really they can do 90 pts of busines value while needing 10 pts allocated to defect and tech debt efforts. Management doesn't distinguish between these efforts however when looking at the team velocity.
Management has figured out the customer backlog is 1000 story points, so they plan that Team A needs 10 iterations to complete the project which fits within customer timeline. Really the team needs more like 11-12 iterations.
Now PO/PM doesn't want to hear this above problem, because the project is fixed scope,budget, and timeline so there are 2 places to stretch: Deliver a fully featured, lower quality product or make your dev team work for free (salaried employees love this ;). The PO doesn't want to negotiate scope with the customer; its easier to internalize this problem rather than work with the customer to find a solution.
As a scrum master here's how I combat this: I let the PO create a tech debt story that is worth 0 story points BUT I get him to prioritize it higher than some lower priority feature work. I do this during iteration planning where I have all the technical folks tell the PO that this tech debt REALLY REALLY REALLY needs to be addressed now or it will hurt the project big time over coming iterations.
At the close of the iteration, that low priority feature work gets carried over to the next iteration and the PO is forced to do some expectation management with the customer. In the meantime I have forced the team's velocity down from say 100 units to 90 units this iteration. I keep doing this over and over again until the team's average velocity is actually representative of what business value they can deliver while still getting to work on tech debt and defects.
The next time this team is utilized on a project, management has a clearer understanding that they should only consider a business value velocity of 90 units when committing to a fixed scope/budget/timeline project.