Its design and Pokedex entries don't look very rocky to me. Please don't question my curiosity.
Nihilego is made of a glassy/crystalline substance. Glass and crystals are generally solid and rigid, and the Rock type fits that description well. Carbink, Gigalith and Diancie are examples of crystals being in the category of Rock-types. Also, glass is made by superheating sand, which is comprised of tiny particles of crushed-up rocks.
UB-01’s body is composed of a glass-like substance. However, it’s constantly changing shapes, never settling on one. Source