I am confused about the difference between a passive component like resistor and an electronic device like diode. I know about their functionality. But my question is why resistor is not called an electronic device? Because as far as i know, resistors deal with electrons so do diodes.
Actually your classification is not common. In the webshops that sell components the transistors and the resistors bot are electronic components to keep them separate from parts for other areas, for ex. nuts and bolts or glues and paints.
The separation between active and passive electronic components is widely used due their very different nature. Transistors and ICs are active due their ability to make one signal to control another without moving parts.
But the question: The electronics is a subfield in the general electric theory and practice. The resistors have applications in most of the subfields of that. Even some very old AC motors urgently needed resistors for proper starting. But diodes are mostly used in the area that is called "the electronics". That area is based on components that have a design based on electron physics. Diode is one of them.
Resistors can as well be called electric or electronic parts because they are massively needed in the electronics as well as in other areas of electrics.
The first classification is for active devices and passive devices.
Active devices require an additional power supply or input voltage to operate (transistors and therefore ICs, valves).
Passive devices produce their effect on their own without additional power (resistors, capacitors, inductors). They are made from conductors and insulators with a very large impedance difference between the two materials to set them apart. (Even a 100 megohm resistor is still a conductor compared to the insulating material wrapped around.) Passive properties are like those produced by 'found' materials or materials not made for electrical purposes, such as copper, carbon (coal/coke), glass and plastic. Their behaviour is usually described by fairly simple mathematics and independent of exact current and voltage magnitudes i.e. the devices readily scale from very small to very large with only construction and materials the major considerations.
Some components seem passive in not requiring power but pass current through semiconductors rather than conductors. For example, a diode does not conduct significantly until it is forward-biased by Vf volts (where Vf depends on the device but is something like 0.2..0.8 V). It then conducts a relatively high current but with this voltage drop still present and spoiling otherwise resistor-like-ish behaviour. These characteristics are artificial and come from its materials having properties not found in nature but created by manufacturing processes specific to electronics. This leads them to be categorised as electronic components because they do not fit 'passive'.