Writing medium-sized amounts of imperative code is wrong if it is going to be shared with any other person than a single developer writing it. And even if only a single person will ever see it, you are still better off writing it in components once the project reaches a certain size.
There's nothing inherently wrong with writing imperative code, and being imperative doesn't imply the code isn't broken up into components or that it's necessarily difficult to maintain.
Imperative programming and components are 2 different things. The latter could be implemented with numerous approaches including imperative programming
That's true, but when someone mentions writing something in an "imperative style" I think it's common for that to actually just mean one huge file that executes sequentially which is not amenable to testing, having someone else working on a different part of the code without running into lots of merge conflicts, makes it very hard to refactor, etc.