Is it ethical to recieve stipend after publishing enough papers? In my institute, it is necessary for a Ph.D student to publish two research papers in SCI or SCIE journals to become eligible for Ph.D.

Although it is not a sufficient condition, but it is the only key task and the remaining tasks need only the presence of student.

I observed some students (infact very few) completing the process of publishing papers in first 2-3 semesters and does his/her own work independent of Ph.D , such as preparing for competitions, jobs etc., in remaining 3-8 semesters.

Is it ethical to take stipend without doing any actual work?
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.