They weren't actual professionals. They were treated as professionals.
They were officially members of the Soviet Military. However, their only duty was to live, eat, breath Soviet Union ice hockey.
They weren't treated as true amateurs who had to pay for their own training, had other activities (school/work) etc.
The IOC elected to allow professional athletes in 1986 with 1988 being the first games with professionals. The individual sports foundations were then allowed to determine if they would allow professionals. The first time basketball allowed this as in 1992. Figure skaters allowed professionals to compete in 1994 but since then it's been sort of a hybrid approach - they can earn money through endorsements, appearance fees, etc but they can't participate in professional skating shows or competitions.