Generation of tunable entanglement and violation of a Bell-like inequality between different degrees of freedom of a single photon