The fact that you had to go through security indicates a change in security rules between regions. This is since airlines have to follow certain norms for flights entering different regions, in this case Europe. This happened to my while flying Canada to Europe via Iceland where we got off, passed security and got back on.
Even if you were not changing regions, you might have had to deplane and reboard again. This happens because the crew will also clean the plane, refill service items and ensure that no one that got off at that stop left something on board which could be a security risk. I've had a flight that refueled in Alaska where we all had to got off and reboard but not pass security.
There are cases where neither passing security or disembarking are required too, although I have not seen this happen in years.