Using low-temperature scanning tunneling microscopy, we show that monolayer hexagonal boron nitride (h-BN) on Ir(111) acts as ultrathin insulating layer for organic molecules, while simultaneously templating their self-assembly. Tunneling spectroscopy experiments on cobalt phthalocyanine (CoPC) reveal narrow molecular resonances and indicate that the charge state of CoPC is periodically modulated by the h-BN moiré superstructure. Molecules in the second layer show site-selective adsorption behavior, allowing the synthesis of molecular dimers that are spatially ordered and inaccessible by usual chemical means.