Whether or not you want to include stops in your average depends on what kind of ride it is, what your goals are, and what you want the information for. Although as people have pointed out, average speed is not a good metric for performance, if you are trying to see if you are "improving" on a given course, including stoplight time is kind of nonsensical. If you have to wait 2 minutes one day and 3 minutes the next day, the amount of rest you are getting is not going to meaningfully impact your performance, but the extra minute is going to make your total take longer.
Also, for example, if you are on a group ride, the amount of time you may have to wait at a regroup for slower riders isn't really meaningful.