Whether this is appropriate ("ethical") or not depends on the applicable rules.
As per your comment, the funding agency's guidelines don't make the stipend conditional on any performance criteria beyond the two published papers. They also provide for a maximum duration of five years within which the stipend can be consumed.
Producing the papers during the first two or so years and consuming the stipend for the remaining time while advancing one's career in other ways (publishing more, writing grant proposals and applications...) doesn't contradict the applicables rules. It's perfectly appropriate, and perhaps even expected behavior.
If it were not, the agency could have attached further conditions to the continued payment of the stipend, it could have limited the payment to the time that is actually needed to publish the two papers and graduate, or it could have introduced regular performance reviews.
Aside: Most likely, if you graduate early, you will not consume the entire stipend but rather prepare for the job market and move on. Living on a stipend is not terribly attractive, and climbing to a more prestigious position, or one with better research opportunities, is a good career move. The agency will probably also have an interest in their alumni succeeding, "even" if this means paying out the full stipend they promised and budgeted for.