This is general good design principle to make it easier to:
Add new features
Remove old features
The general ideas is to group the specific code and resources for a feature in one spot rather than have designs which scatter the resources across many places.
For instance if you have a new screen that requires some javascript code and an HTML template then a design of putting all of these resources into a self-contained directory is an easier pattern for other programmers to follow when they add a screen.
But perhaps even more importantly it becomes obvious when code is no longer needed. So it makes it easier to eliminate dead code.