Various countries have different laws. Actually, some laws are changing from one state to another. Although cannabidiol is legal in some countries, it is prohibited in other countries.
There are a lot of restrictions attached to the cannabidiol legal status. Cannabidiol can be used in drugs in certain European countries but not for commercial sale, although industrial and medicinal use is legal in some countries, cultivating them is considered illegal.
To understand why different CBDlaws exist, it’s necessary to understand what cannabidiol is.
What is Cannabidiol?
Cannabidiol or CBD is a chemical substance derived from the marijuana or hemp plant varieties. Behind tetrahydrocannabinol or THC, it is the second-most important cannabinoid. While THC is the psychoactive agent found in a cannabis plant, CBD possesses other medicinal properties. Scientists assume CBD is the most important cannabinoid found so far due to a lack of psychoactive agents and beneficial effects on our physical and mental wellbeing.
Cannabidiol may be converted into oils and edibles. These are produced using CBD oil derived from selected cannabis plant types that have a low THC level. The extracted CBD oil is used widely in and in drugs to produce body oils, tinctures, balms, elixirs, and other things. CBD oil is used nowadays in virtually any consumable commodity. In certain countries the selling of CBD oil-related goods is illegal.
What is the legal status of CBD oil in Spain?
In Spain, the use of cannabis is prohibited for commercial purposes. It is considered a felony crime. Yet cannabis can be privately grown and used. Any reason other than the drug trade or selling has been decriminalized. This grey environment has contributed to the creation of cannabis clubs and groups for consumers. Such clubs and societies were founded as non-profit organizations, and they sell their members cannabis.
Major administrative amendments have arisen regarding the legal status of CBD oil in Spain. Spain’s cannabis industry is a combination of Spanish and foreign-owned businesses that sell seeds, fertilizers, hemp-infused drinks, and CBD tinctures, oils, and creams. Distributors, retailers, develop shops, and internet sellers work in a black market that encourages them to sell as long as they obey the laws. 
Any drug that has CBD oil as one of its ingredients cannot be sold in Spain if the THC content reaches 0.2%. The prohibition is because it is in international law. In addition, all hemp growing seeds must be sourced from the Approved European Hemp Seed Catalogue.
CBD oil in food and supplements
In Spain the use of narcotic drugs in food supplements is prohibited, so is the use of CBD, although it has no psychoactive agents. Many stores in Spain were searched, and CBD oil-based goods were seized when AECOSAN, Spain’s health and safety agency, revised the regulations banning the selling and delivery of CBD-containing drugs marketed when food supplements. According to Spanish law, dietary supplements should only contain vitamins, nutrients, amino acids, and fatty acids from the ‘natural’ diet. Spain has made it a rule that CBD oil cannot be used in consumable production. 
CBD oil used in cosmetics
In Spain, CBD oil can be sold under the label ‘only for external use,’ meaning it can be used as an ingredient in cosmetic cream and balm manufacturing. Many firms have launched a line of products using CBD oil.
Use of CDB oil for medical purposes in Spain
Medical cannabis is not regulated in Spain, and cannabis production in Spain is subject to prior authorization from the Spanish Drugs and Medicinal Devices Department or AEMPS for the purpose of cannabinoid extraction. Five firms in Spain have been issued testing licenses for the cultivation of cannabis.
Of testing purposes, a distinction must be made between CBD-rich products and CBD-enriched products. Spain prohibits the use of narcotic medications as medical products. But CBD is free of psychoactive agents, and so its medicinal use has recently become lawful in the country. 
The legal status of CBD oil-based products in Spain
All across Europe Cannabis firms are marketing their goods in Spain. They sell either online or through stores. Such distributors or exporters have been hit because they are required to recall their goods or re-label them to sell for commercial purposes on the Spanish market because Spain has made CBD oil illegal.
Because Spain is the center for hemp production, the manufacture of selling derivatives is only made legal for sale to a business approved in its home country. 
References https://www.growbarato.net/blog/en/is-cbd-legal-in-spain/#:~:text=In%20Spain%20the%20use%20and,products%20is%20the%20Medicines%20Agency.  https://cannabislaw.report/guest-article-the-legal-status-of-cbd-oil-in-spain/  https://www.eirhealth.com/is-cbd-legal-in-spain