When placing a block that has a BlockEntityTag such as a spawner, the tag will only be used if the block is placed in creative (left spawner), not survival (right spawner).
Command used:
/give @s mob_spawner{BlockEntityTag:{SpawnData:{id:piston_extension},RequiredPlayerRange:0}}
Only opped players in creative have the ability to use BlockEntityTag, EntityTag, command blocks and debug sticks. This is by design.