So, a "cave" for a Glow Squid or Axolotl to spawn in can be considered of ANY block above a water source even if it is a transparent block like glass which do not prevent sky light. I am not sure if this is intented to work like that but in case it should not I made this report.
How to test it:
Start a new world with a "2*minecraft:water" layer and a "minecraft:glass" layer above that.
Axolotls and Glow Squids will start spawning in the water.
With the spawning conditions of Axolotls & Glow Squids changes is this still an issue for you in 1.17?