There is a common saying in Spanish (at least in Spain):
Por el interés te quiero, Andrés.
According to the RAE, we have the following meanings for interés:
- m. Provecho, utilidad, ganancia.
- m. Valor de algo.
- m. Lucro producido por el capital.
- m. Inclinación del ánimo hacia un objeto, una persona, una narración, etc.
- m. pl. bienes.
- m. pl. Conveniencia o beneficio en el orden moral o material.
The first meaning is the most general one, and the one that fits the expression: interés means profit, earnings. The last meaning could also fit, as is a similar one.
So, as you have said in the question, the sentence means that something has been done all of a sudden and driven by a given interest, expecting a profit from that. The example I give at the start of the answer illustrates that the expression can contain also an article, as interés is a noun.
Por interés is then a common expression, and quite old (emphasis mine):
Cosa muy ordinaria es prender a un hombre sin más culpa o razón que el gusto del ministro. Hazen los tales mercaduría del oficio, o ya por interés o por vengança, y esto es lo menos, porque también suelen prenderle para, en el ínterin, escalarle la casa o quitarle la honra, que a tanto alcança su tiranía y imperio.
Gonzalo de Céspedes y Meneses, "Varia fortuna del soldado Píndaro", 1626 (España).
And quite used still nowadays:
Creo que éstos o parecidos argumentos subyacen en el fondo de esas ayudas económicas que en algunos países como Francia otorga el Estado a las familias por hijo nacido. Más que por solidaridad es por interés propio, pues son inversiones que revierten a medio y largo plazo.
PRENSA, "El Diario Vasco, 23/01/2004 : OPINIÓN", 2004 (España).
This last example also illustrates that por interés can also be followed by a qualifier, in this case por interés propio, but it can also be por interés personal, por interés mutuo, por interés económico, and so on. In any case, doing something por interés is doing something for the possible benefits, as opposed to doing something por altruismo.