My teacher said it more closely resembles a real infection but I didn't get that.
It's not necessarily true that attenuated vaccines are "preferable" to killed vaccines. It's a case by case basis. In some cases one or the other simply isn't possible or practical. It may not be possible to make a vaccine that's attenuated enough, for example. Or a killed vaccine may not be effective.
Here are some pros and cons of attenuated vaccines:
- more likely to follow the natural path of infection, so there might be more immunity at the specific site of infection. For example, attenuated vaccines against gut pathogens might drive gut-specific immunity.
- Might replicate in the host so that the actual amount of antigen seen by the host is greater than the amount delivered -- so you can deliver a much smaller dose to get similar immunity
- Might cause more inflammation. Inflammation can drive a much stronger immune response because the body "thinks" it's being attacked by a dangerous pathogen
- Might cause more inflammation. Inflammation can cause tissue damage or local pain
- May be less safe. Replicating in the host may give the opportunity to mutate and become more dangerous
- May be more fragile. A killed vaccine could be relatively temperature stable, while an attenuated vaccine might need to be kept in a very narrow temperature range so it doesn't die and become ineffective. That might make it difficult to use in, say, developing countries
There are many more points that could be made but the overall picture is that attenuated vaccines might be more effective but more dangerous. Attenuated vaccines that are used today have been shown to be safe as well as effective, and killed vaccines that are in use have been shown to be effective as well as safe, so these are concerns during development of new vaccines, not in use of present ones.