First of all, it is illegal in Spain to traffic cannabis. Selling the drug can lead to one to three years of jail time as well as a fine, with steeper penalties for those selling higher amounts of the drug, as well as for past offenders.
That being said, it is legal in Spain to cultivate or smoke cannabis for your own personal use. As long as you consume the drug in the privacy of your own home, or elsewhere on private property, you're not doing anything illegal. It's also legal to buy and sell paraphernalia such as seeds and other hemp products.
You'll also find people smoking at cannabis clubs, which have sprung up throughout the country as a result of the 2015 law decriminalizing marijuana in private spaces. Today, there are an estimated 700 cannabis clubs throughout Spain, and they come in all different forms.