The personal motivation for becoming an editor are based on prestige and service to the community.
The primary goals of a journal depend on the publisher. Learned societies including e.g. ACM and IEEE in engineering or the Royal Society are intent on the spread of science and engineering, help their members e.g. by providing publication outlets, and their own prestige, whereas commercial established editors look for revenue by establishing a journal as a brand. Some newer editors forego the establishment of a brand.
Publishing can be extremely profitable as university libraries have to provide access to publications. With the exception of predatory publishers and commercial editors who maximize short-term profit, the goal is to have a product that is prestigious enough that their main customers, i.e. university libraries, just have to buy their product.
To build a brand, a journal needs to contain sought-after articles. A good journal enjoys a virtuous circles. By having already published good articles, the journal attracts authors with good articles who prefer the name recognition of the journal to other outlets. This makes it more likely for libraries to subscribe to the journal, which gives it also more recognition among potential authors. By specialization, a new journal might find both an audience and a group of authors.
In the short term, an editor has to fill the journal with good quality articles justifying the subscription fees. Over the last decades, the costs of adding one page to a journal has gone down, which takes away one big reason for limiting the size and number of articles published. However, a journal that accepts just about everything will lose prestige and no longer attract good authors. The quality of editing and reviewing also enters the picture. Bad reviewing and having articles retracted as a consequence is a big loss of prestige.
In the last decades, informal renomée has been replaced with bibliometric measures such as impact factor. These are more important for the less prestigious journals and are also the target for "gaming the system".