Typically if you are denied entry to Costa Rica the airline that you arrived on is held responsible by immigration, must pay a fine, and must fly you home within 24 hours. Since this is expensive and inconvenient for the airline they typically try to be sure you will be permitted to enter.