How do you balance "must do" work (compliance, maintenance, etc.) with objective/goal oriented work?
Before jumping into the "must do" work, it's best to understand the reason for doing the work.
Sometimes the "must do" work is warranted. For example, compliance could have high customer impact which naturally means that it'll get prioritized anyways. Sometimes the "must do" work is not impactful. For example, there might be a set of maintenance tasks that is necessary but it's highly manual and repetitive. While it needs to be done, it's more exciting for the team to reduce/eliminate this work through automation than continue doing it over and over again.
At the end of the day, there will always be some level of "must do" work. The key is to reduce the unimpactful/repetitive tasks. Once those things are eliminated, the team is often happy to take the more impactful (even if mildly annoying) "must do" work.
The balance/percentage should be agreed upon by the EM and the PM and shared with the broader org for visibility. For example, in a team of 5 engineers, one engineer's time could be set aside for 'must do' work and the rest will continue to focus on goal strategic efforts. Similar approach can be applied if the organization is big - eg. one pod assigned for maintenance work and 2 pods working on strategic efforts.
In the end, key is alignment with the broader organization and stakeholders so right expectations are set!
The main risk is constantly deprioritizing the Compliance and maintenance work and building a tech debt at such a level that it will take forever to pay it back.
There are two kinds of situations:
1- you do not have a vast tech debt, and you can manage compliance and maintenance work by allocating a fraction (10 to 30%, depending on the amount of work)of your capacity to this work. The remaining capacity work on development-related work.
Alternatively, whenever a developer touches a part of the code, you impose that he improves (or maintains) a part related to what he just changed.
2- You have let the tech debt grow out of control: you will have no more choice. You will need to allocate your capacity to pay the tech debt before you go "tech bankrupt."
When the tech debt is back under control, you can apply the rules stated in 1st paragraph.