With an upwards facing dispenser with no block underneath, a villager (or a pig, and possibly other mobs, which is untested) will fall through the dispenser when spawned. If there is a block underneath it, the mob will spawn inside the dispenser, or halfway inside the dispenser in the case of 2 block tall mobs.
Duplicate of MC-8293, please use the search function to see if your bug has already been submitted. Currently over 54% of tickets are being closed as duplicate.