Why did drive-ins stop operating in North America?
In addition to the above answer, it might be surmised that the growing population made land more expensive. Drive-ins needed a lot of parking space, especially drive-in movie theaters. It may have been that the land was not being employed for what is called its "highest and best use." The property owners would tend to keep raising rents until the restaurant or theater owner could not make a profit on the enterprise.
Drive-in theaters typically could only show one feature or perhaps one double-feature. Most theaters that only had one show during a given time period have gone out of business because it is far more cost-effective to have multiplex theaters with multiple projectors and only one projectionist. These familiar multiplex theaters with as many as twenty auditoriums can obviously attract more people because they can offer a variety of shows to appeal to different kinds of audiences. There are kids' pictures for families, action-adventure pictures for young couples, etc.
Are you talking about drive-in theaters or drive-in restaurants. In either case, I would argue that the reasons are similar.
In both cases, changes in technology and tastes made drive-ins less appealing to consumers. As cars became smaller, the idea of sitting in your car, motionless, to eat became less appealing. The same holds for sitting there for an entire movie. At the same time, both eating and (in particular) being entertained at home became easier. There are many more restaurants that deliver food now and many more kinds of easy-to-make foods, in addition to the rise of take-out fast food chains. TV and, later, VCRs and video games and such cut into the appeal of drive-in movies.
In these ways, changes in technology and changes in what is perceived as fun and cool led to the demise of drive-ins.