The above two statements seem somewhat contradictory. Scripture says God gives the Spirit to those who obey Him (Acts 5:32). The clear implication of Peter as he spoke these words to the disobedient Sanhedrin is that the Lord will not give the Holy Spirit to those who won't obey Him. Then the second Scripture quotation above says that God doesn't ration the Holy Spirit (Jn 3:34), but pours out the Spirit in unlimited measure.
In truth, God has lavished the Spirit "on all mankind" (Acts 2:17). Nevertheless, when we disobey God, we turn our backs on Him and His will. In our disobedience, we put a lid over the earthen vessel of our life (see 2 Cor 4:7) and refuse to receive His unrationed flow of the Spirit. We stifle the Spirit (1 Thes 5:19).
Sometimes our disobedience may not stem from outright rebellion, but simply weakness. We don't have a spiritual lid on our life; we receive the Holy Spirit, but we can't retain the Spirit. Our sins and weaknesses cause cracks in the vessels of our lives. We leak like broken cisterns (see Jer 2:13).
On the first Easter, Jesus breathed on His apostles and said, "Receive the Holy Spirit" (Jn 20:22). The Easter season is a time of pouring out the Spirit, so ask the Lord for the grace to repent of any disobedience and anything that might stifle or sadden the Spirit (1 Thes 5:19; Eph 4:30) in your life. Make an Easter Confession to repair the cracks in your life, and ask the Father to pour out His love in your heart through the Holy Spirit (Rm 5:5).