Compact Groups in the UZC galaxy sample: II. Connection between morphology, luminosity and large-scale density