It can be. You can release under a "source available" license barring it from being used (even compiled), derived, incorporated into other works, making it basically "for eyes only, or we sue you to oblivion".
Many people consider licenses as window decorations, but they are not.